<Rad:RadGrid Height="350px" Width="100%" ID="RadGridFields" Skin="Windows7" BorderStyle="Solid" runat="server" AllowPaging="True" GridLines="None" AllowMultiRowEdit="true" AllowAutomaticUpdates="True" AllowSorting="True" AllowMultiRowSelection="false" OnUpdateCommand="RadGridFields_UpdateCommand" OnNeedDataSource="RadGridFields_NeedDataSource" OnItemDataBound="RadGridFields_ItemDataBound" AutoGenerateColumns="false"> <MasterTableView TableLayout="Fixed" DataKeyNames="LabelText" EditMode="InPlace" AllowPaging="false" Width="100%" NoMasterRecordsText=""> <Columns> <Rad:GridEditCommandColumn HeaderText="Edit" HeaderStyle-Width="55px" ButtonType="ImageButton" EditText="Edit" UniqueName="EditCol" /> <Rad:GridTemplateColumn UniqueName="LabelText" HeaderText="LabelText" HeaderStyle-Width="200px" DataField="LabelText"> <ItemTemplate> <%#DataBinder.Eval(Container.DataItem, "LabelText")%> </ItemTemplate> <EditItemTemplate> <Rad:RadTextBox runat="server" ID="textLabel" AutoPostBack="true" Height="140px" Width="200px" /> </EditItemTemplate> </Rad:GridTemplateColumn> <Rad:GridTemplateColumn UniqueName="Mandatory" HeaderText="Mandatory" HeaderStyle-Width="80px" DataField="Mandatory"> <ItemTemplate> <%#DataBinder.Eval(Container.DataItem, "Mandatory")%> </ItemTemplate> <EditItemTemplate> <Rad:RadComboBox runat="server" ID="comboMandatory" AutoPostBack="true" HighlightTemplatedItems="true" Height="140px" Width="80px" DropDownWidth="200px" OnSelectedIndexChanged="comboMandatory_SelectedIndexChanged" > <Items> <Rad:RadComboBoxItem Value="False" Text="False" /> <Rad:RadComboBoxItem Value="True" Text="True" /> </Items> </Rad:RadComboBox> </EditItemTemplate> </Rad:GridTemplateColumn> <Rad:GridTemplateColumn UniqueName="DefaultText" HeaderText="DefaultText" HeaderStyle-Width="200px" DataField="DefaultText"> <ItemTemplate> <%#DataBinder.Eval(Container.DataItem, "DefaultText")%> </ItemTemplate> <EditItemTemplate> <Rad:RadTextBox runat="server" ID="textDefault" AutoPostBack="true" Height="140px" Width="200px" /> </EditItemTemplate> </Rad:GridTemplateColumn> </Columns> </MasterTableView> <ClientSettings> <ClientEvents OnRowDblClick="editThisRow" OnCommand="onClientCommand" /> <Scrolling AllowScroll="true" ScrollHeight="100%" /> <Selecting AllowRowSelect="true" /> </ClientSettings> </Rad:RadGrid>I want to show some data on a radgrid. I want all the columns texts to be editable from the beginning. Later I want to save the data. Above I have given my code in ascx control. Noe this is my code in cs page
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { RadGridFields.DataSource = gridTable; RadGridFields.DataBind(); foreach (GridDataItem item in RadGridFields.MasterTableView.Items) { item.Edit = true; } RadGridFields.Rebind(); } } }When I run this all the columns become editable. But all the checkboxes contain false value and all textboxes contain blank value. I want previous datas to be there and from that data user can edit. If I remove
foreach (GridDataItem item in RadGridFields.MasterTableView.Items) { item.Edit = true; } RadGridFields.Rebind(); }this part from code then all datas are there..when I double click on the then the row's data vanishes. Need Help..Thanks in advanced