Add Mode Problem For RadListBox

1 posts, 0 answers
  1. mohamed
    mohamed avatar
    311 posts
    Member since:
    Mar 2011

    Posted 08 Jun 2011 Link to this post

    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.
Back to Top