Hello,
I am facing one problem. I have used GridTemplate and have dropdown in edit mode as shown below.
| <telerik:GridTemplateColumn UniqueName="StatusColumn" HeaderText="Approved Status"> |
| <ItemTemplate> |
| <asp:Label id="lblStatus" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "status") %>'> |
| </asp:Label> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <asp:DropDownList id="ddlApprovalStatus" runat="server" > |
| <asp:ListItem Text="Pending" Value="False"></asp:ListItem> |
| <asp:ListItem Text="Approved" Value="True"></asp:ListItem> |
| </asp:DropDownList> |
| </EditItemTemplate> |
| <ItemStyle Width="40px" /> |
| </telerik:GridTemplateColumn> |
I had set AllowAutomaticUpdates="True" of Rad grid and binding grid with SqlDataSource
i had set status field in database as bit. Now if i update the record in grid then it set null in database. I suppose it doesn't pick the dropdown value and is picking the textvalue, and bit datatype in database in not able to store my text, that is why its storing null.
How to pick selected value field of dropdown?
I am using SqpDataSource like this
| <asp:SqlDataSource ID="SqlDataSource1" runat="server" |
| ConnectionString="<%$ ConnectionStrings:test %>" |
| DeleteCommand="DELETE FROM [Test] WHERE [id] = @id" |
| InsertCommand="INSERT INTO [Test] ([name], [phone], [email], [company], [status]) VALUES (@name, @phone, @email, @company,@StatusColumn)" |
| SelectCommand="SELECT [id], [name], [phone], [email], [company], [status], [username], [password], [cmsmemberid] FROM [ltsConsultant]" |
| UpdateCommand="UPDATE [Test] SET [name] = @name, [phone] = @phone, [email] = @email, [company] = @company, [status] = @StatusColumn WHERE [id] = @id"> |
| <DeleteParameters> |
| <asp:Parameter Name="id" Type="Int32" /> |
| </DeleteParameters> |
| <UpdateParameters> |
| <asp:Parameter Name="name" Type="String" /> |
| <asp:Parameter Name="phone" Type="String" /> |
| <asp:Parameter Name="email" Type="String" /> |
| <asp:Parameter Name="company" Type="String" /> |
| <asp:Parameter Name="StatusColumn" Type="String" /> |
| <asp:Parameter Name="id" Type="Int32" /> |
| </UpdateParameters> |
| <InsertParameters> |
| <asp:Parameter Name="name" Type="String" /> |
| <asp:Parameter Name="phone" Type="String" /> |
| <asp:Parameter Name="email" Type="String" /> |
| <asp:Parameter Name="company" Type="String" /> |
| <asp:Parameter Name="StatusColumn" Type="String" /> |
| </InsertParameters> |
| </asp:SqlDataSource> |