In edit mode in gridview everytime ihave to select dropdownlist otherwise its store first value

<asp:GridViewID="GVTrouserJobWork"runat="server"  
AutoGenerateColumns="False"CssClass="Gridview"HeaderStyle-BackColor="#4B6D9D
"DataKeyNames="TrouserJobID"
OnRowCancelingEdit="GVTrouserJobWork_RowCancelingEdit"OnRowDeleting="GVTrouserJobWork_RowDeleting"
OnRowEditing="GVTrouserJobWork_RowEditing"OnRowUpdating="GVTrouserJobWork_RowUpdating">
<Columns>
<asp:TemplateFieldHeaderText="StyleNo"
<asp:LabelID="lblStyleNo"runat="server"Text='<%#Eval("StyleNo")
%>'/>
<asp:DropDownList Width="60px"  DataSource='<%# GetStyleNo() %>' DataTextField="StyleNo"
                                    DataValueField="StyleNo" ID="StyleNo"
runat="server">
                                </asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:LabelID="lblStyleNo1"runat="server"Text='<%#Eval("StyleNo")
%>'/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
public
DataSetGetStyleNo() {
SqlConnectionmyConnection =
newSqlConnection(ConfigurationManager.ConnectionStrings["constring"].ToString());
SqlCommandcmd =
newSqlCommand();
                cmd.Connection = con;
                cmd.CommandText =
"StleMasterList";
                cmd.CommandType =
CommandType.StoredProcedure;
SqlDataAdapterad =
newSqlDataAdapter("StleMasterList",
myConnection);
//SelectDDCompanyName
DataSetds =
newDataSet();
                ad.Fill(ds,
"StleMasterList");
return
ds;
StleMasterList = Select StyleNo from Stylemaster
protectedvoid
GVTrouserJobWork_RowUpdating(objectsender,
GridViewUpdateEventArgse)
intTrouserOrderID =
Convert.ToInt32(GVTrouserOrderDetail.DataKeys[e.RowIndex].Value.ToString());
DropDownListStyleNo = (DropDownList)GVTrouserOrderDetail.Rows[e.RowIndex].FindControl("StyleNo");
SqlCommandcmd =
newSqlCommand("update
TrouserOrders set StyleNo='"+
StyleNo.SelectedValue.ToString() + "'where
TrouserOrderID="+ TrouserOrderID, con);
 cmd.ExecuteNonQuery();
 con.Close();
lblresult.ForeColor =Color.Green;
lblresult.Text = " Details Updated successfully";
GVTrouserOrderDetail.EditIndex = -1;
BindTrouserOrderDetails();
Actually I get dropdown in editmode but when without selecting dropdownlist if I update it it select first value of dropdown list.
if have two dropdownlist in gridview and I want to update only one I cant do this every time I have to select both
dropdownlist .

Hello Fresherss,
I think the ASP.NET forum will be more suitable for this thread:
http://forums.asp.net/
There are ASP.NET experts who will help you better.
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Address Book Notes for New Contacts Appear Only In Edit Mode

    When I create a new contact in +Address Book+, exit Edit mode, and then add a Note to that new contact, the note is visible only when the contact is switched to Edit mode. This does not effect existing contacts. This problem first appeared yesterday. I didn't do anything unusual with +Address Book+ before the emergence of the problem.
    I followed these instructions to rebuild the +Address Book+ database but it had no effect on this problem: "Quit Address Book and drag ~/Library/Application Support/AddressBook/AddressBook-v22.abcddb to the desktop. It will be rebuilt from the details in Metadata when you restart AB."
    Thank you in advance for any ideas you have!
    Steven

    I exported the contact list and deleted Library/Application support/Address book and then re-imported.  Everything is fine now.

  • DataGrid enters in edit mode after alert is closed

    Hi, i tried to fix this by myself but i just couldn't.
    This is the problem:
    I added  KeyboardEvent.KEY_DOWN event listener for data grid and if key code is 46 (delete btn) alert is shown to ask user if he wants to delete that selected row and that is working without problem but when alert is closed data grid enters in edit mode. Why is this happening? Also i noticed that last field that has been edited will enter in edit mode regardless of what row is selected.
    This is the code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="init()">
    <mx:Script>
         <![CDATA[
              import mx.controls.Alert;
              private function init():void
                   testGrid.addEventListener(KeyboardEvent.KEY_DOWN, dataGridKeyDown);
              private function dataGridKeyDown(e:KeyboardEvent):void
                   if(e.keyCode == 46)
                        Alert.show("Do you really want to delete row", "Program",(Alert.OK | Alert.NO));
         ]]>
    </mx:Script>
    <mx:ArrayCollection id="arrColl">
             <mx:Object>
                <mx:col1>Pavement</mx:col1>
                <mx:col2>11.99</mx:col2>
                <mx:col3>Slanted and Enchanted</mx:col3>
             </mx:Object>
             <mx:Object>
                <mx:col1>Pavement</mx:col1>
                <mx:col2>Brighten the Corners</mx:col2>
                <mx:col3>11.99</mx:col3>
             </mx:Object>
          </mx:ArrayCollection>
         <mx:DataGrid editable="true" id="testGrid" width="450" height="300" dataProvider="{arrColl}">
              <mx:columns>
                   <mx:DataGridColumn headerText="Col 1" dataField="col1"/>
                   <mx:DataGridColumn headerText="Col 2" dataField="col2"/>
                   <mx:DataGridColumn headerText="Col 3" dataField="col3"/>
              </mx:columns>
         </mx:DataGrid>
    </mx:Application>
    So this is how it looks when alert is shown:
    And when i click OK or NO in alert box and when alert box  disappear grid automatically enter in edit mode and looks like this:
    Any help is  appreciated as this is really annoying issue.

    Use this code after you download the Flex SDK 3.4 and perform the same operation as you want.Please test this.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                        layout="vertical"
                        creationComplete="init()">
         <mx:Script>
              <![CDATA[
                   import mx.events.CloseEvent;
                   import mx.controls.Alert;
                   private function init():void
                        testGrid.addEventListener(KeyboardEvent.KEY_DOWN, dataGridKeyDown);
                   private function dataGridKeyDown(e:KeyboardEvent):void
                        if (e.keyCode == 46)
                             Alert.show("Do you really want to delete row", "Program", (Alert.YES | Alert.NO),this,deleteHandler);
                             testGrid.editable = false;
                   private function deleteHandler( e:CloseEvent ):void
                        if( e.detail == Alert.YES )
                             // delete
                        else
                             // do not delete
                        testGrid.editable = true;
              ]]>
         </mx:Script>
         <mx:ArrayCollection id="arrColl">
              <mx:Object>
                   <mx:col1>Pavement</mx:col1>
                   <mx:col2>11.99</mx:col2>
                   <mx:col3>Slanted and Enchanted</mx:col3>
              </mx:Object>
              <mx:Object>
                   <mx:col1>Pavement</mx:col1>
                   <mx:col2>Brighten the Corners</mx:col2>
                   <mx:col3>11.99</mx:col3>
              </mx:Object>
         </mx:ArrayCollection>
         <mx:DataGrid editable="true"
                         id="testGrid"
                         width="450"
                         height="300"
                         dataProvider="{arrColl}">
              <mx:columns>
                   <mx:DataGridColumn headerText="Col 1"
                                          dataField="col1"/>
                   <mx:DataGridColumn headerText="Col 2"
                                          dataField="col2"/>
                   <mx:DataGridColumn headerText="Col 3"
                                          dataField="col3"/>
              </mx:columns>
         </mx:DataGrid>
    </mx:Application>

  • Can't save any changes made in EDIt mode?

    HI all
    I am new to apple products ... but I am now playing with iPhoto 11. I am able to import my photos from my camera with no problems. And then, in EDIT mode, under "adjust" I am able to make a lot of nice changes - De-noise, sharpness, etc.. - but I don't have a button to allow me to save? I have looked at the user guides on line and they talk of a DONE button - but I don't have one? And when I go back to the photo library and look at the photos there, the changes I have made are not shown. But if I click on each photo individualy and click on EDIT again - the changes I made are saved? But I can only see my changes whilst in the EDIT mode per photo?
    How do I save my edits back to the photo library? I want to uploaded the photos with the changes I made - but everytime I try an upload -- even a single photo - I get the original photo before my edits
    Any help would be appreciated please
    Thanks
    Chris

    Your database is a  bit mucked up (<- Technical term, that)
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • ALV colors in edit mode

    Hello,
    I have an ALV grid with an editable checkbox column.
    Now I have two problems regarding the colors:
    1. as you know, when in edit mode, the colors change. I overrode them with custom colors, but the editable column's cells have still a white margin which I cannot get rid of
    2. Zebra layout does not work anymore. If I color the rows with a zebra pattern manually, I would have to re-do it everytime the table is resorted.
    Can anyone think of a better way to handle coloring in edit mode?
    Thanks a lot.

    hi,
    Chk this link.
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_color.htm
    Regards
    Reshma

  • C# - How to show SPListItems in edit mode on Application (ASPX) page? Is it so difficult?

    Hi there,
    In my code-behind page - I have a collection of SPListItems. I need to display them in the application page (aspx page) in edit mode. How can I do that please?
    Thank you so much.

    Hello,
    Usually grid is the good option to update list item in bulk. You can use simple asp.net gridview as telerik is commercial product. Here is some good ref for you:
    http://sharepointparthiban.blogspot.sg/2013/04/sharepoint-list-item-update-using.html
    http://sharepoint.kerenapura.com/2013/10/update-sharepoint-list-data-gridview-part-1/
    You also need to clarify whether you want to update SPField or SPListItems because in thread title you have mentioned SPField.
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Aspx double click Edit button in GridView?

    I have a GridView with the Edit Button for editing which works, just makes me click it twice before it goes into Edit Mode. Does anyone know why this would be? Let me know if I can show you anything - code or html.
    Code in Page_Load:
    gvClients.AutoGenerateEditButton = isAdmin   gvClients.AutoGenerateDeleteButton = isAdmin
    Private Sub gvClients_RowCommand(sender As Object, e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gvClients.RowCommand
    Dim row = CInt(e.CommandArgument.ToString)
    If e.CommandName = "Edit" Then
    gvClients.EditIndex = row
    End If
    End Sub
    Thanks for looking.

    Hi,
    I think the ASP.NET forum will be a better forum for you to ask this question, and you will get a good reply from there:
    #ASP.NET forum:
    http://forums.asp.net/
    Thank you for your understanding.
    Best Regards,
    Franklin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Can't open photos in edit mode

    I can;t open photos in edit mode in iPhoto '08. When I double click on a photo the main window remains blank (no "!" no"?"). This problem occurs with every photo in the library. My permissions are OK. I've also tried setting the preferences to edit in Photoshop but double clicking on the photos then still accomplishes nothing.

    Steve:
    Do you get a blank white window in the edit mode? If so that may mean you do not have access to the files. Try the following:download and run BatChmod on the iPhoto Library folder with the settings shown here, putting your administrator login name, long or short, in the owner and group sections. You can either type in the path to the folder or just drag the folder into that field.
    FYI:
    Using Photoshop (or Photoshop Elements) as Your Editor of Choice in iPhoto.
    1 - select Photoshop as your editor of choice in iPhoto's General Preference Section's under the "Edit photo:" menu.
    2 - double click on the thumbnail in iPhoto to open it in Photoshop. When you're finished editing click on the Save button. If you immediately get the JPEG Options window make your selection (Baseline standard seems to be the most compatible jpeg format) and click on the OK button. Your done.
    3 - however, if you get the navigation window that indicates that PS wants to save it as a PS formatted file. You'll need to either select JPEG from the menu and save (top image) or click on the desktop in the Navigation window (bottom image) and save it to the desktop for importing as a new photo.
    This method will let iPhoto know that the photo has been editied and will update the thumbnail file to reflect the edit..
    If you want to use both iPhoto's editing mode and PS without having to go back and forth to the Preference pane, once you've selected PS as your editor of choice, reset the Preferences back to "Open in main window". That will let you either edit in iPhoto (double click on the thumbnail) or in PS (Control-click on the thumbnail and seledt "Edit in external editor" in the Contextual menu). This way you get the best of both worlds
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Can't view photos in edit mode

    Hello,
    I just upgraded to iPhoto '08, and while I can view all my thumbnails ok, the photos themselves won't load at all in edit mode.
    I was using iPhoto to try to"jumpstart" my iWeb (per my other help request in another topic) when I noticed this.
    I have Leopard 10.5.2, iPhoto 7.1.2 and a 1.8 GHz processor and 512 MB RAM in my upgraded G4 tower. I tried deleting the preferences file, rebuilding the library file, opening in another account, etc, with no luck. I had even just erased my hard drive and cleanly re-installed Leopard, etc. with still the same problems in both apps. Do I just need to add more memory perhaps? I can't think of anything else...?Does Leopard require much more memory than Panther (which I had before) to run properly?
    Thanks,
    Paul

    I've had the what sounds like the exact same problem with iPhoto '08. I, too, have an upgraded 1.8 GHz G4 (AGP Graphics) running OS 10.5.3 (although the original installation was 10.5.1 and the same problem occurred before the software updates). When I try to edit a photo, the edit window opens but no picture appears. Clicking on the various editing tools and manipulating them (blindly, on a blank screen) shows that editing is actually taking place, and that changes can be saved.
    An earlier post of mine concerned the first problem I noticed since my OS and processor updates; namely, that the DVD player app won't work, but instead returns an error message saying that a valid device could not be found for playback. Several responses to that post seemed to suggest that the ATI Rage 128 video card might be the culprit and that it would need to be replaced. In the past week I've been on the phone or in email contact with tech support people at ATI, Sonnet, Other World Computing, and Apple, the last being the least knowledgeable of all of them, I'm sorry to say.
    The Sonnet guy personally runs a computer just like mine, but with the ATI Radeon 9800 Pro Mac video card. That item costs $209 at OWC. But ATI says it won't work because of the G4's 200 power supply.
    These folks think that the iPhoto problem would be solved by the new video card -- but I'm not yet convinced I want to spend that kind of money to find out. Most also say that the DVD Player issue would be fixed, although the OWC guy says it has nothing to do with it.
    So we're going blind here, with much conflicting expert opinion. I'll keep watching for further discussion.
    cc

  • Unable to open a view in edit mode

    Hi All,
    I have a Notes assignment block in the Account Overview page. It contains a text area and an EDIT button to modify the notes. Corresponding view and context node for this block are  BP_DATA/NOTES and NOTES respectively. Notes context node is bound to Text context node of the component controller.
    The issue is, when agent confirms an account, goes to Overview page and clicks on EDIT button of the Notes block, then, if the block already has some text, then it turns in to EDIT mode. But if Notes section is empty initially, then, on click of EDIT button will not make the view editable.
    During debugging, I can see that if notes section is already filled with some text, then there is an entity in the collection wrapper of the NOTES context node(also in the component controller collection wrapper). But if notes section is initially empty, then collection wrapper is empty(both view and component controller context nodes).
    My requirement is to make the notes section editable even if there is no text present in it initially. It will be very helpful if someone could give me suggestions on this issue.
    Thanks and Regards,
    Naren

    Hi Nitish,
    Thanks for your reply. Infact I only coded the event handler. In the first line, I am reading the entity from the collection wrapper of the context node. If it is bound, only then I can set it in EDIT mode.
    ob_entity ?= me->typed_context->notes->collection_wrapper->get_current( ).
    IF ob_entity IS BOUND.
    Sets the view in EDIT mode
    Now, ob_entity is null if there is initially no data in the notes section of the confirmed account. However, if notes is not empty, then, ob_entity is bound and I can set the view to edit mode. This is the issue.
    Regards,
    Naren

  • How can I open an email file in edition mode?

    Hi!
    I use a system here in my company that generates an automatic email and prepare it to be sent.
    We were using MS Outlook and we have migrated to thunderbird for lots of reasons.
    But since it has migrated, the system cannot generate this email in the composition screen.
    It generates in the inbox.
    Is there anything I can do to change this?
    I have made a few tests and I realize that the same thing happens if I save an email file in my computer and
    try to open if with the thunderbird. It's supposed to open in edition mode, so the user can send it out, with just one click.
    Thank you!

    https://support.mozilla.org/en-US/questions/1004680

  • Text Caption appears in Edit Mode but not in Preview Project or Web Browser

    I'm using Cp4 and have downloaded Adobe Flash 10 Active X, it's ver 10.1.82.76.  I've added a simple text caption with these options:
    Timing Display:  Rest of slide
    Appear after:  2.0 seconds
    Transition effect:  Fade in only
    In: .5 seconds
    And Visible is checked
    I also have a simple line that I drew with the draw line tool and included an arrow on the end of it.
    Everything on the screen works including the click box, the animated text and the failure caption.  For some reason the text caption and the arrow are not appearing except in Edit Mode.  In Preview Project, they disapper but the click box, failure caption and animated text work fine.
    I've rebooted, copied this screen into a new instance of Cp4, re-created these objects on a freshly recorded screen, chosen Order: Bring to Front, created a brand new screen completely from scratch and downloaded the Flash 10 Active X version mentioned above.
    They funny thing is, is that the text caption and arrow works fine on other screens in the project.  I have 76 screens total.
    I'm running Windows XP.
    Any suggestions?

    Hi there
    Can you post a screen capture of what your Timeline looks like?
    Odds are your Click Box is pausing in a weird place.
    Cheers... Rick
    Helpful and Handy Links
    Begin learning Captivate 5 moments from now! $29.95
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcererStone Blog
    Captivate eBooks

  • Ctrl+tab is not working in editing mode

    I have JcheckBox and JTable in my JPanel. When user clicks or presses F2 to edit any cell value of the JTable a comboBox will appear with possible values. (This comboBox is coming from table CellEditor). When user presses ctrl+tab from the table focus should transfer to JComboBox all time. It is working only when the user presses ctrl+tab from the table cell which is not in editing mode. If the user presses ctrl+tab from the table cell which is in editing mode (i.e. focus is on the ComboBox of the cellEditor) it does not work. Please help me to find the solution.
    I give a sample code here for your reference.
    public class Frame1 extends JFrame {
    public Frame1()
    super();
    this.setLayout( null );
    this.setSize( new Dimension(400, 300) );
    JTextField ch = new JTextField();
    ch.setVisible(true);
    ch.setBounds(10, 10, 10, 10);
    this.add(ch, null);
    DefaultTableModel tmodel = new DefaultTableModel(3, 1);
    tmodel.setValueAt("0 0 1",0,0);
    tmodel.setValueAt("1 0 1",1,0);
    tmodel.setValueAt("2 0 1",2,0);
    JTable custLayersTable = new JTable(tmodel);
    custLayersTable.getColumnModel().getColumn(0).
    setCellEditor(new ComboEditor());
    custLayersTable.setBounds(new Rectangle(40, 40, 280, 145));
    custLayersTable.setSurrendersFocusOnKeystroke(true);
    this.add(custLayersTable, null);
    public static void main(String[] args)
    Frame1 a = new Frame1();
    a.setVisible(true);
    final class ComboEditor extends AbstractCellEditor
    implements TableCellEditor
    public Component getTableCellEditorComponent(JTable table,
    Object value,
    boolean isSelected,
    int row,
    int column)
    Vector<String> layerValSet = new Vector<String>();
    for(int i=0; i<3; i++)
    layerValSet.add(row+" "+column+" "+i);
    mComboModel = new DefaultComboBoxModel(layerValSet);
    mComboModel.setSelectedItem(value);
    mEditorComp = new JComboBox(mComboModel);
    return mEditorComp;
    public Object getCellEditorValue()
    return mEditorComp.getSelectedItem();
    private DefaultComboBoxModel mComboModel;
    private JComboBox mEditorComp;
    }

    Thanks a lot for your reply.
    Since the textField is in a different class i could not use the transferFocus API directly. I tried the following code in the keyreleased event of Combo Box but it was not working.
    KeyboardFocusManager.getCurrentKeyboardFocusManager().focusNextComponent(
    e.getComponent().getParent());
    I also tried the following code in stopCellEditing and is not working.
    KeyboardFocusManager.getCurrentKeyboardFocusManager().focusNextComponent();
    Is there any other way to achieve this?

  • Deleted Items Stay in Edit mode?

    When Adding Items to a portal, for instance an Image... and then I want to delete that image... I can delete it so the image no longer shows on the finished page, but the Item still shows in the Edit mode. How do I delete the Item so it no longer shows in Item mode

    Assuming that you are using 10g:<br><br>
    Yes, you can disable this feature. Click on Properties of the Page Group that you want to disable this feature. Go to the third tab Items.<br><br>
    On this tab you will see 2 options :<br>
    Retain Deleted Items <br>
    Display Unpublished, Expired, and Deleted Items In Edit Mode <br><br>
    Either enable or disable based on your preferences.

  • FBL5N - Feild selection non editable mode

    Hi All,
    When i execute FBL5N transaction,i am not able to select the feilds as per my desire bcoz the feild display ICON is in non editable mode.
    The only option i have is layout selection and not the feilds selection.
    Can you let me know how to change it to editable mode.
    regards

    Hello,
    You don't have authorization for maintain ALV layouts. Please contact to your Basis department for authorization.
    ALV layout authorization object is S_ALV_LAYO. Please tell your Basis departman to give this object value for '23'.
    Regards,
    Burak

Maybe you are looking for