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

RadGrid Edit Mode

2 Answers 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ghadeer
Top achievements
Rank 1
ghadeer asked on 03 Dec 2008, 05:50 AM
Hi All,
I have gridTemplateColumn  with checkboxlist inside the EditItemtemplate  and label inside the Itemtemplate, the problem is when I click on editbutton all the selected  item become unselected!!!!!!!!!!

how can I keep the value in edit mode???????

thanks in advance
ghadeer 

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Dec 2008, 07:06 AM
Hi Ghadeer,

How you are binding the CheckBoxList in your case. Sending your aspx will be more good. Here is the code which I tried on my end.

ASPX:
 <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="AccessDataSource1" AutoGenerateColumns="false" 
                AutoGenerateEditColumn="true"
                <MasterTableView> 
                    <Columns> 
                        <telerik:GridTemplateColumn UniqueName="CategoryID" HeaderText="CategoryID" DataField="CategoryID"
                            <ItemTemplate> 
                                <asp:Label ID="CategoryIdLabel" runat="server" Text='<%# Eval("CategoryID") %>'></asp:Label> 
                            </ItemTemplate> 
                            <EditItemTemplate> 
                                <div style="border:solid 1px black;"
                                <asp:CheckBoxList ID="CheckBoxList1" runat="server" DataSourceID="AccessDataSource1"  
                                DataTextField="CategoryName" DataValueField="CategoryID" RepeatDirection="Vertical" RepeatColumns="4"
                                </asp:CheckBoxList> 
                                </div> 
                            </EditItemTemplate> 
                        </telerik:GridTemplateColumn> 
                    </Columns> 
                </MasterTableView> 
              
            </telerik:RadGrid> 
         
                     
      
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb" 
            SelectCommand="SELECT [CategoryID], [CategoryName] FROM [Categories]"></asp:AccessDataSource> 

Shinu
0
ghadeer
Top achievements
Rank 1
answered on 03 Dec 2008, 08:08 AM

Hi there,
<

telerik:GridTemplateColumn UniqueName="Ceretificate" AllowFiltering="False" HeaderText="Ceretificate Type" >

 

 

 <

ItemStyle Width="30%"></ItemStyle>

 

 

 <

ItemTemplate>

 

 

 

<asp:Label runat="server" ID="lblCertificate" Text='<%# Eval("CERTIFICATE") %>' ></asp:Label>

 

 

 

</ItemTemplate>

 

 

<

EditItemTemplate>

 

 

 

<asp:CheckBoxList ID="cblCertificate" runat="server" CssClass="checkbox" RepeatDirection="Horizontal" RepeatLayout="Flow" >

 

 

 

<asp:ListItem Value="0" Text="Certificate of Employment" ></asp:ListItem>

 

 

 <asp:ListItem Value="1" Text="Original/copy of my Passport" ></asp:ListItem>

 

 

<asp:ListItem Value="2" Text="Travel Permit" ></asp:ListItem>

 

 

<asp:ListItem Value="3" Text="Letter To Trafic Police" ></asp:ListItem>

 

 

<asp:ListItem Value="4" Text="Depdent Visa Application"></asp:ListItem>

 

 

<asp:ListItem Value="5" Text="Other" ></asp:ListItem>

 

 

</asp:CheckBoxList>

 

 

</EditItemTemplate>

 

 

<HeaderStyle Width="30%" />

 

 </

telerik:GridTemplateColumn>


this my aspx , Plz if you could help me , because when I click update ,CERTIFICATE feild become empty


regards
ghadeer

 

 

 

Tags
Grid
Asked by
ghadeer
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
ghadeer
Top achievements
Rank 1
Share this question
or