This is a migrated thread and some comments may be shown as answers.

how to display the dropdownselected value in editmode

0 Answers 30 Views
Grid
This is a migrated thread and some comments may be shown as answers.
shanker bangari
Top achievements
Rank 1
shanker bangari asked on 26 Jun 2010, 12:26 PM
Hi,

i doing one application .i taking this example demo http://demos.telerik.com/aspnet-ajax/grid/examples/programming/accessingcellsandrows/defaultcs.aspx.i wrote pro-grammatically my code is 
  protected void maintaintimetablegrid_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e) 
        { 
            if (e.Item is GridEditFormItem && e.Item is GridEditableItem && e.Item.IsInEditMode) 
            { 
                RadComboBox formRadclass = e.Item.FindControl("formRadclass"as RadComboBox; 
                if (formRadclass != null
                { 
                    formRadclass.AutoPostBack = true
                    formRadclass.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(formRadclass_SelectedIndexChanged); 
                } 
                RadComboBox formRadSubject = e.Item.FindControl("formRadSubject"as RadComboBox; 
                if (formRadSubject != null
                { 
                    formRadSubject.AutoPostBack = true
                    formRadSubject.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(formRadSubject_SelectedIndexChanged); 
                } 
 
            } 
 
        } 
        void formRadclass_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e) 
        { 
            //first reference the edited grid item through the NamingContainer attribute 
            GridEditableItem editedItem = (sender as RadComboBox).NamingContainer as GridEditableItem; 
            RadComboBox formRadroom = editedItem.FindControl("formRadroom"as RadComboBox; 
            if (formRadroom != null
            { 
                formRadroom.Items.Clear(); 
                RadComboBoxItem item1 = new RadComboBoxItem(); 
                item1.Text = "Select Room"
                formRadroom.Items.Add(item1); 
                formRadroom.DataSource = Calendermanager.sch_view_class_default_room((editedItem.FindControl("formRadclass"as RadComboBox).SelectedValue.GetInteger()); 
               formRadroom.DataBind(); 
            } 
            RadComboBox formRadSubject = editedItem.FindControl("formRadSubject"as RadComboBox; 
            if (formRadSubject != null
            { 
                formRadSubject.Items.Clear(); 
                RadComboBoxItem item2 = new RadComboBoxItem(); 
                item2.Text = "Select Subject"
                formRadSubject.Items.Add(item2); 
                int? faciltyid = LogonDetails.Instance.sys_lclvar_default_facility_id; 
                formRadSubject.DataSource = classmarksheetmanager.sch_view_class_subject_lookup((editedItem.FindControl("formRadclass"as RadComboBox).SelectedValue.GetInteger(), faciltyid); 
                formRadSubject.DataBind(); 
            } 
            
        } 
        void formRadSubject_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e) 
        { 
            //first reference the edited grid item through the NamingContainer attribute 
            GridEditableItem editedItem = (sender as RadComboBox).NamingContainer as GridEditableItem; 
            RadComboBox formRadTeacher = editedItem.FindControl("formRadTeacher"as RadComboBox; 
            if (formRadTeacher != null
            { 
                formRadTeacher.Items.Clear(); 
                RadComboBoxItem item1 = new RadComboBoxItem(); 
                item1.Text = "Select Teacher"
                formRadTeacher.Items.Add(item1); 
                formRadTeacher.DataSource = Calendermanager.sch_view_class_subject_teacher_lookup((editedItem.FindControl("formRadclass"as RadComboBox).SelectedValue.GetInteger(), (editedItem.FindControl("formRadSubject"as RadComboBox).SelectedValue.GetInteger()); 
                formRadTeacher.DataBind(); 
            } 
            
 
        } 
 

how to display the dropdownseleted text value  in edit mode .above example take drodowncloumns but am taking in editmode directly dropdowns.How to write the code pro-grammatically above example 

No answers yet. Maybe you can help?

Tags
Grid
Asked by
shanker bangari
Top achievements
Rank 1
Share this question
or