locked
insert in gridview RRS feed

  • Question

  • User103329589 posted

    hi for all I have gridview I want to insert throw it

     <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"                 CellPadding="4" DataKeyNames="ID" DataSourceID="SqlDataSource1"                 ForeColor="#333333" GridLines="None" AllowPaging="True"                                 style="font-family: 'Times New Roman', Times, serif; font-size: large; font-weight: 700"                 ShowFooter="True">                 <AlternatingRowStyle BackColor="White" />                 <Columns>                     <asp:BoundField DataField="ID" HeaderText="id"                         ReadOnly="True" SortExpression="ID" />                     <asp:BoundField DataField="Name" HeaderText="name"                         SortExpression="Name" />                     <asp:TemplateField HeaderText="grade"SortExpression="Grade">                         <EditItemTemplate>                             <telerik:RadComboBox ID="RadComboBox1" Runat="server"                                 DataSourceID="SqlDataSource2" DataTextField="GradeDesc"                                 DataValueField="GradeID">                             </telerik:RadComboBox>                             <asp:SqlDataSource ID="SqlDataSource2" runat="server"                                 ConnectionString="<%$ ConnectionStrings:ConnectionString %>"                                 SelectCommand="SELECT * FROM [Grades]"></asp:SqlDataSource>                         </EditItemTemplate>                         <ItemTemplate>                             <asp:Label ID="Label1" runat="server" Text='<%# Eval("Grade") %>'></asp:Label>                         </ItemTemplate>                     </asp:TemplateField>                     <asp:TemplateField HeaderText="per" SortExpression="Per">                         <EditItemTemplate>                             <telerik:RadComboBox ID="rdauthorization" Runat="server">                                 <Items>                                     <telerik:RadComboBoxItem runat="server" Text="1" Value="1" />                                     <telerik:RadComboBoxItem runat="server" Text="2" Value="2" />                                 </Items>                             </telerik:RadComboBox>                         </EditItemTemplate>                         <ItemTemplate>                             <asp:Label ID="Label2" runat="server" Text='<%# Eval("PerTypeID") %>'></asp:Label>                         </ItemTemplate>                     </asp:TemplateField>                     <asp:BoundField DataField="Section" HeaderText="Section"                         SortExpression="Section" />                     <asp:CommandField CancelText="cancel" DeleteText="delete" EditText="edit" InsertText="add"                         ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="true"                         NewText="add" />                 </Columns>                 <EditRowStyle BackColor="#2461BF" />                 <FooterStyle BackColor="#507CD1" BorderColor="#66FF33" Font-Bold="True"                     ForeColor="White" />                 <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />                 <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />                 <RowStyle BackColor="#EFF3FB" />                 <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />                 <SortedAscendingCellStyle BackColor="#F5F7FB" />                 <SortedAscendingHeaderStyle BackColor="#6D95E1" />                 <SortedDescendingCellStyle BackColor="#E9EBEF" />                 <SortedDescendingHeaderStyle BackColor="#4870BE" />             </asp:GridView> any one can modify to me this code to accept insert note in column per I want to make enitial values for combobox thanks

    Sunday, March 25, 2012 12:13 AM

Answers

All replies