protected
void Update_Command(object source, Telerik.WebControls.GridCommandEventArgs e)
{
//GridEditableItem editedItem = e.Item as GridEditableItem;
//UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
This is what I'd like to do is get the blankety blank row ID of the row I'm editing
//string admissionID = (userControl.FindControl("admissionID") as TextBox).Text; I get error with object not set to....null reference etc. when code above is uncommented out for userControl
This is what I'd like to do is get the blankety blank edited stuff
//string ssn = (userControl.FindControl("ssn") as TextBox).Text; I get error with object not set to....null reference when code above is uncommented out for userControl
//UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
//Hashtable newValues = new Hashtable();
//newValues["admissionID"] = (userControl.FindControl("admissionID") as TextBox).Text;
//newValues["ssn"] = (userControl.FindControl("ssn") as TextBox).Text;
//TextBox admissionIDTxBx = (TextBox)userControl.FindControl("admissionID");
//TextBox ssnIDTxBx = (TextBox)userControl.FindControl("ssn");
var db = new admissions_appsDataContext();
var query = from s in db.admission_app2s
where s.admissionID == "randysolutions@hotmail.com" would like to put admissionID grabed as edited row field identifier
select s;
foreach (var thisItem in query)
{
//foreach (DictionaryEntry entry in newValues)
//{
//if (thisItem.admissionID == admissionIDTxBx.Text)
thisItem.ssn =
"123456789"; would like to put ssn The stuff entered in the editable textbox as this code with everything commented out simply updates this row in the database.
//}
//if (thisItem.admissionID == (userControl.FindControl("admissionID") as TextBox).Text)
//{
// thisItem.ssn = "12345";//(userControl.FindControl("ssn") as TextBox).Text;
//}
}
db.SubmitChanges();
//var db = new admissions_appsDataContext();
//db.SubmitChanges(
var dbRefresh = new admissions_appsDataContext();
var queryRefresh = db.admission_app2s;
RadGrid1.DataSource = queryRefresh;
RadGrid1.DataBind();
<asp:Panel ID="divFixPanel" runat="server">
x.. header controls in this panel than remain static on the page..
</asp:Panel>
<asp:Panel ID="divScroll" runat="server" Style="overflow-y: scroll; overflow-x: auto;
width: 100%; height: expression(screen.height-document.getElementById('ctl00_ContentPlaceHolder1_divFixPanel').offsetHeight-(window.screenTop+60) + 'px');">
x
x
x editor1
x editor 2
x editor 3
</asp:Panel>

<
telerik:GridTemplateColumn HeaderText="Device Type" SortExpression="DeviceDisplayValue"
UniqueName="DeviceTemplateColumn" EditFormColumnIndex="1">
<ItemTemplate>
<asp:Label runat="server" ID="lblDevice" Text='<%# Bind("DeviceDisplayValue") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox ID="ddlDeviceAW" runat="server" EnableLoadOnDemand="true"
LoadingMessage="Loading Device..." MarkFirstMatch="True" ToolTip="Select a Device"
OnItemsRequested="ddlDeviceAW_ItemsRequested" EnableVirtualScrolling="true">
</telerik:RadComboBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
I want to populate the dropdown from code behind on runtime.
How do i find the combo box in the grid in my ItemsRequested event?
<radG:GridDropDownColumn DataField="SectionCategory" DataSourceID="SqlDataSource_SectionsCategory" HeaderText="SectionCategory" ListTextField="Name" ListValueField="ID" UniqueName="SectionCategoryID">
</radG:GridDropDownColumn>
Using the following datasource:
<asp:SqlDataSource ID="SqlDataSource_SectionsCategory" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"SelectCommand="SELECT ID, Name FROM Sections"></asp:SqlDataSource>
This is fine, but what I need to do is add an extra value to the dropdown that isn't in the database. I'm assuming this needs to be done in the code behind, but not sure how to go about doing it. Could you please give me some idea of how to go about doing this?
Thanks in advance.