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

Add Mode Problem For RadListBox

0 Answers 55 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
mohamed
Top achievements
Rank 1
mohamed asked on 08 Jun 2011, 05:12 AM
Hello every one ,

When i click the add new button radlist box come empty ,
But here come with last record of radgrid
In Modify i assign the value for RadGrid1_ItemCreated,
That's assign in add mode also
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
       {
           if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
           {
               GridEditFormItem item = (GridEditFormItem)e.Item;
               RadListBox listbox = (RadListBox)item.FindControl("RadListBoxDestinationGroup");
               RadListBox listbox1 = (RadListBox)item.FindControl("RadListBoxSourceGroup");
               RadComboBox sortcolumn = (RadComboBox)item.FindControl("ComboBox_SortColumn");
               RadComboBox groupcolumn = (RadComboBox)item.FindControl("ComboBox_GroupByColumn");
 
               listbox.DataSource = DbClient.GetList<ListField>("LayoutId =" + LayoutId);
               listbox.DataValueField = "FieldName";
               listbox.DataTextField = "FieldName";
 
               sortcolumn.DataSource = DbClient.GetList<ListField>("LayoutId =" + LayoutId);
               sortcolumn.DataValueField = "FieldName";
               sortcolumn.DataTextField = "FieldName";
 
               groupcolumn.DataSource = DbClient.GetList<ListField>("LayoutId =" + LayoutId);
               groupcolumn.DataValueField = "FieldName";
               groupcolumn.DataTextField = "FieldName";
           }
       }




Thanks,
Mohamed.

No answers yet. Maybe you can help?

Tags
ListBox
Asked by
mohamed
Top achievements
Rank 1
Share this question
or