I have a rad grid and on every row i have rad toggle button, now i want whenever user change state of toggle button then in javascript i have to get row index of rad grid.
I have written following
its giving me toggle button that state just changed but now i want row index of radgrid where this control resides
function toggleStateChangedDir(sender, args) { var getElement= $telerik.$(sender.get_element()); }
Hi
Below is a snippet of markup from a RadGrid. These colunms do not show when I have UseStaticHeader=true.
Andy Ideas.
Andy
<telerik:RadGrid ID="rdDashboard" runat="server" AutoGenerateColumns="False" EnableEmbeddedSkins="False" Skin="Activity" GridLines="None" EnableViewState="true" GroupingSettings-CaseSensitive="false" ClientSettings-Scrolling-UseStaticHeaders="true" ClientSettings-Scrolling-AllowScroll="true" Height="730px" > <MasterTableView DataKeyNames="ID"> <Columns> <telerik:GridBoundColumn DataField="ID" UniqueName="ID" Visible="false" SortExpression="ID" HeaderText=" … "></telerik:GridBoundColumn> <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="AppointmentEdit" UniqueName="AppointmentEdit"> <HeaderStyle Width="1px" /> <ItemStyle Width="1px" /> </telerik:GridButtonColumn> <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="ViewDemog" UniqueName="ViewDemog" SortExpression="Demog" HeaderText=" … "> <HeaderStyle Width="1px" /> <ItemStyle Width="1px" /> </telerik:GridButtonColumn> <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="IsVulnerable" UniqueName="IsVulnerable"> <HeaderStyle Width="1px" /> <ItemStyle Width="1px" /> </telerik:GridButtonColumn> <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="VisuallyImpaired" UniqueName="VisuallyImpaired"> <HeaderStyle Width="1px" /> <ItemStyle Width="1px" /> </telerik:GridButtonColumn> <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="HearingImpaired" UniqueName="HearingImpaired"> <HeaderStyle Width="1px" /> <ItemStyle Width="1px" /> </telerik:GridButtonColumn> <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Transport" UniqueName="Transport"> <HeaderStyle Width="1px" /> <ItemStyle Width="1px" /> </telerik:GridButtonColumn> <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Porter" UniqueName="Porter"> <HeaderStyle Width="1px" /> <ItemStyle Width="1px" /> </telerik:GridButtonColumn> <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Interpreter" UniqueName="Interpreter"> <HeaderStyle Width="1px" /> <ItemStyle Width="1px" /> </telerik:GridButtonColumn> <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="ReceptionAlert" UniqueName="ReceptionAlert"> <HeaderStyle Width="1px" /> <ItemStyle Width="1px" /> </telerik:GridButtonColumn> <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="PASAlert" UniqueName="PASAlert"> <HeaderStyle Width="1px" /> <ItemStyle Width="1px" /> </telerik:GridButtonColumn> <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="AdditionalEvent" ImageUrl="~/Content/Images/Scales_24.png" UniqueName="AdditionalEvent" SortExpression="AdditionalEvent" HeaderText=" … " HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"> <HeaderStyle Width="1px" /> <ItemStyle Width="1px" /> </telerik:GridButtonColumn>
I have a GridRating column in my RadGrid. My Grid is populated by Javascript at run time and there is no design time or code behind databinding. Is there a way the Rating column can be accessed at javascript level in OnRowDataBound method and the value set for the same?
Thanks

I have a RadGrid setup like this
<div id="Grid"> <telerik:RadGrid RenderMode="Lightweight" runat="server" ID="RadGrid1" AutoGenerateColumns="false" AllowPaging="true" OnNeedDataSource="UserGrid_NeedDataSource" OnUpdateCommand="RadGrid1_UpdateCommand" OnItemCreated="RadGrid1_ItemCreated" OnDeleteCommand="RadGrid1_DeleteCommand" OnInsertCommand="RadGrid1_InsertCommand"> <MasterTableView DataKeyNames="UserID" CommandItemDisplay="Top" EditMode="EditForms"> <Columns> <telerik:GridEditCommandColumn /> <telerik:GridBoundColumn DataField="UserID" HeaderText="User ID" ReadOnly="true" ForceExtractValue="Always" ConvertEmptyStringToNull="true" /> <telerik:GridCheckBoxColumn DataField="Active" HeaderText="Active" SortExpression="Active" UniqueName="chkActive"></telerik:GridCheckBoxColumn> <telerik:GridTemplateColumn HeaderText="Role"> <ItemTemplate> <%#DataBinder.Eval(Container.DataItem, "Role")%> </ItemTemplate> <EditItemTemplate> <asp:DropDownList runat="server" ID="ddlRoles"> <asp:ListItem Text ="Admin" Value ="Administrator"></asp:ListItem> <asp:ListItem Text ="User" Value ="User"></asp:ListItem> </asp:DropDownList> </EditItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" UniqueName="FirstName" /> <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" UniqueName ="LastName"/> <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" UniqueName="UserName" /> <telerik:GridBoundColumn DataField="EmailAddress" HeaderText="Email Address" UniqueName="Email" /> <telerik:GridButtonColumn ConfirmText="Delete this User?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="FontIconButton" CommandName="Delete" /> </Columns> <EditFormSettings InsertCaption="Add new item" CaptionFormatString="Edit User: {0}" CaptionDataField="FirstName"> <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn> </EditFormSettings> </MasterTableView> <PagerStyle Mode="NextPrevAndNumeric" /> </telerik:RadGrid> </div>
I want to udpade or add new records using C# code behind. However I cannot get access to any of the controls. When thew code attemps to read the value of the value of the control, in this case a textbox, I get an error message stating {"Object reference not set to an instance of an object."} here is the code
protected void RadGrid1_UpdateCommand(object sender, GridCommandEventArgs e) { GridEditableItem editedItem = e.Item as GridEditableItem; UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID); string strUserID = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["UserID"].ToString(); int intUserId = Convert.ToUInt16(strUserID); using (ExpungeEntities db = new ExpungeEntities()) { var Results = db.USERS_T_DATA.SingleOrDefault(i => i.UserID == intUserId); if (Results == null) { RadGrid1.Controls.Add(new LiteralControl("Unable to locate that user for updating")); e.Canceled = true; return; } Results.FirstName = (userControl.FindControl("FirstName") as TextBox).Text; } }Can you please tell me what the problem is?
Hello Guys,
I am new to Telerik Controls and my question is
How do i embed dropdownlist ( Or radcombobox ) and editable text box indise a radgrid ?
Please refer to attachment
( Dropdownlist or radgrid should populate from datasource)
I have already written the logic for edit delete save commands but to display them inside the grid is my doubt

I have a page on which a user enters a few search criteria via drop down lists, and then searches for org chart results based on those criteria. I am having a strange issue in which the first time the search button is clicked, the org chart is displayed, but the formatting is wrong, and it's flowing off the screen.
See included screen shots of the first time the search button is clicked, and the second time. Second (and subsequent) search executions all render correctly.
<telerik:RadOrgChart RenderMode="Lightweight" runat="server" ID="RadOrgChart1" OnDataBound="radOrgChartDataBound" Orientation="Vertical" EnableCollapsing="true" EnableDrillDown="false" EnableDragAndDrop="false" EnableGroupCollapsing="true"><ItemTemplate> <asp:Label runat="server" ID="lblEmployee" Text='<%# DataBinder.Eval(Container.DataItem, "Employee") %>' /> <asp:Label runat="server" ID="lblAlternate" Text='<%# DataBinder.Eval(Container.DataItem, "ALternate") %>' /> <asp:HiddenField runat="server" id="hfLead" Value='<%# DataBinder.Eval(Container.DataItem, "TeamLead") %>' /> <strong><%# DataBinder.Eval(Container.DataItem, "Payroll") %></strong></ItemTemplate> <GroupEnabledBinding> <NodeBindingSettings DataFieldID="ID" DataFieldParentID="ParentID" /> <GroupItemBindingSettings DataFieldID="ID" DataFieldNodeID="NodeID" DataTextField="Employee" /></GroupEnabledBinding> <RenderedFields> <NodeFields> <telerik:OrgChartRenderedField DataField="Text" Label="" /> </NodeFields></RenderedFields></telerik:RadOrgChart>
protected void loadOrgChart() { try { DataTable dtNodes = new DataTable(); DataTable dtItems = new DataTable(); if (cnn.State == ConnectionState.Closed) { cnn.Open(); } sqlStr = " *** long sql query string here *** "; SqlCommand cmd = new SqlCommand(sqlStr, cnn); dtNodes.Load(cmd.ExecuteReader()); cnn.Close(); if (cnn.State == ConnectionState.Closed) { cnn.Open(); } sqlStr = " *** long sql query string here *** "; cmd = new SqlCommand(sqlStr, cnn); dtItems.Load(cmd.ExecuteReader()); cnn.Close(); RadOrgChart1.GroupEnabledBinding.NodeBindingSettings.DataSource = dtNodes; RadOrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataSource = dtItems; RadOrgChart1.GroupColumnCount = 1; for (int i = 0; i < dtNodes.Rows.Count; i++) { bool hasParent = false; string parentID = dtNodes.Rows[i]["ParentID"].ToString(); for (int j = 0; j < dtNodes.Rows.Count; j++) { if (dtNodes.Rows[j]["ID"].ToString() == parentID) { hasParent = true; } } if (!hasParent) { dtNodes.Rows[i]["ParentID"] = DBNull.Value; } } RadOrgChart1.DataBind(); } catch (Exception ex) { lblError.Text = ex.ToString(); } editSection.Visible = true; upEditarea.Update(); } protected void radOrgChartDataBound(object sender, EventArgs e) { RadOrgChart orgChart = RadOrgChart1; foreach (OrgChartNode node in orgChart.GetAllNodes()) { foreach (OrgChartGroupItem item in node.GroupItems) { Label lblEmployee = (Label)item.FindControl("lblEmployee"); Label lblAlternate = (Label)item.FindControl("lblAlternate"); HiddenField hfLead = (HiddenField)item.FindControl("hfLead"); if (lblEmployee.Text == "Vacant Position") { lblEmployee.ForeColor = System.Drawing.Color.Red; } if (hfLead.Value == "True") { lblAlternate.Visible = true; if (lblAlternate.Text == "No Alternate") { lblAlternate.ForeColor = System.Drawing.Color.Red; } } else { lblAlternate.Visible = false; } } int nodeLevel = node.Level; if (nodeLevel > 0) { node.Collapsed = true; } } }
I'm new to the radorgchart function and using telerik tools in general, so any advice on where I should be looking for the source of this issue is greatly appriciated.