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

[Solved] How to give editindex=-1 in radgrid

1 Answer 260 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 10 Feb 2010, 09:59 AM
Hi,

this is shanker am develop one application . that is radcomobox filtering in gridview when ever am selected   the combo box item the grid view is filtering and populate . it's fine it,s working, But am update radgridview values in update commande event in edit mode is edit form .So  when eve am click the edit button the radgridview is clear the data .am missing index value how to give editindex=1 just like "gridview editindex =e.neweditindex "  how to solve that am not using linq datasourcecontrol am just like this my sample code is 

it's my databind of grid
 protected void Exam_nameview_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            int? facilty_id = LogonDetails.Instance.sys_lclvar_default_facility_id;
            classExamscheduleView.DataSource = classexamshedulemanager.sch_view_exam_schedule_detail_list(facilty_id, Exam_nameview.SelectedValue.GetInteger());
            classExamscheduleView.DataBind();
       }
 protected void classExamscheduleView_DeleteCommand(object source, GridCommandEventArgs e)
        {
           
        }

        

        protected void classExamscheduleView_UpdateCommand(object source, GridCommandEventArgs e)
        {
         
        }

        protected void classExamscheduleView_ItemDataBound(object sender, GridItemEventArgs e)
        {
          
        }

        protected void classExamscheduleView_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (!Page.IsPostBack && e.Item is GridEditableItem)
            {
                e.Item.Edit = true;
            }
        }

how to solve that please it's argent  please help me

thanks and regards 
shanker.B

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Feb 2010, 07:40 AM
Hi,

I  am not sure of your question,but if you are  trying to cancel the edit mode ,you can use the code snippet below:

 RadGrid1.EditIndexes.Clear(); 
 RadGrid1.Rebind(); 


You should also use the Advanced DataBinding Technique to bind your grid . This way you wont need to explicitly rebind the grid.

Thanks,
Princy
Tags
Grid
Asked by
shanker bangari
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or