or
Hello,
Is there a way to bind a RadToolbar programmatically in the code behind to a RadGrid?.
The reason I need this is because I have created a three tier Hierarchy grid in the page init, which I want to eventually edit with the radtoolbar.
I know that I can do RadGrid1.MasterTableView.CommandItemDisplay = ?? but I am having problems finding out how to bind the radtoolbar itself.
Perhaps someone can guide me to a document or the steps I need to do?
Thanks.
| function onSuccess(result) { |
| var grid = $('#<%= RadGrid1.ClientID %>'); |
| var tableView = grid.get_masterTableView(); |
| tableView.set_dataSource(result); |
| tableView.dataBind(); |
| $('#<%= RadAjaxLoadingPanel1.ClientID %>').hide("<%= RadGrid1.ClientID %>"); |
| } |
| <%@ Control Language="VB" AutoEventWireup="false" CodeFile="AssemblyControl.ascx.vb" Inherits="Module_FloorControl_AssemblyControl"%> | |
| <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> | |
| <table width="100%" border="0" cellspacing="0" cellpadding="10" style="border: 1px solid #C0C0C0; font-family: Verdana; font-size: 10px; color: #4A535B; font-weight: bold;"> | |
| <tr> | |
| <td bgcolor="#F3F3F1"><table width="100%" border="0" cellspacing="5" cellpadding="0"> | |
| <tr> | |
| <td width="80" height="25" align="right" >*Model:</td> | |
| <td width="500" valign="middle" > | |
| <telerik:RadTextBox ID="ModelTxt" Runat="server" Skin="Default" LabelCssClass="radLabelCss_Gray" | |
| Width="125px" Enabled="False"> </telerik:RadTextBox> </td> | |
| <td valign="middle" > </td> | |
| </tr> | |
| <tr> | |
| <td width="80" height="25" align="right" >*PCBA:</td> | |
| <td width="500" valign="middle" > | |
| <telerik:RadTextBox ID="PCBATxt" Runat="server" Skin="Default" LabelCssClass="radLabelCss_Gray" | |
| Width="125px"> </telerik:RadTextBox> </td> | |
| <td valign="middle" > </td> | |
| </tr> | |
| <tr> | |
| <td width="80" height="25" align="right" >*Description:</td> | |
| <td width="500" valign="middle" > | |
| <telerik:RadTextBox ID="DescriptionTxt" Runat="server" Skin="Default" LabelCssClass="radLabelCss_Gray" | |
| Width="200px"> </telerik:RadTextBox> </td> | |
| <td valign="middle" > </td> | |
| </tr> | |
| <tr> | |
| <td width="80" height="25" align="right" >Mother Board:</td> | |
| <td width="500" valign="middle" > | |
| <telerik:RadComboBox ID="MotherBoardDdl" Runat="server" Skin="Default"> | |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> | |
| </telerik:RadComboBox> | |
| </td> | |
| <td valign="middle" > </td> | |
| </tr> | |
| <tr> | |
| <td width="80" height="25" align="right" >Main Board: </td> | |
| <td width="500" valign="middle" > | |
| <asp:CheckBox ID="MBCHK" runat="server" /> | |
| </td> | |
| <td valign="middle" > </td> | |
| </tr> | |
| <tr> | |
| <td width="80" height="25" align="right" >Remarks:</td> | |
| <td width="500" valign="middle" > | |
| <telerik:RadTextBox ID="RemarksTxt" Runat="server" Skin="Default" | |
| LabelCssClass="radLabelCss_Gray" Width="370px" | |
| Columns="50" Height="80px" TextMode="MultiLine"> </telerik:RadTextBox> </td> | |
| <td valign="middle" > </td> | |
| </tr> | |
| <tr> | |
| <td align="center" ></td> | |
| <td align="left" colspan="2" > | |
| <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Hay" GridLines="None" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" Width="97%" PageSize="10" | |
| AllowAutomaticUpdates="True" AllowPaging="True" AutoGenerateColumns="False" OnInsertCommand="RadGrid1_InsertCommand"> | |
| <MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="SeqNo" | |
| HorizontalAlign="NotSet" AutoGenerateColumns="False"> | |
| <Columns> | |
| <telerik:GridClientSelectColumn HeaderStyle-Width="40px" > | |
| <HeaderStyle Width="40px"></HeaderStyle> | |
| </telerik:GridClientSelectColumn> | |
| <telerik:GridBoundColumn DataField="Model" HeaderText="Model" SortExpression="Model" UniqueName="Model" EditFormColumnIndex="0"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="PCBA" HeaderText="PCBA" UniqueName="PCBA" EditFormColumnIndex="0"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="SeqNo" HeaderText="Seq No" SortExpression="SeqNo" UniqueName="SeqNo" EditFormColumnIndex="1"> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridDropDownColumn DataField="Process" HeaderText="Process" ListTextField="Process" ListValueField="Process" UniqueName="Process" EditFormColumnIndex="1" FilterListOptions="AllowAllFilters"> | |
| </telerik:GridDropDownColumn> | |
| <telerik:GridDropDownColumn DataField="FailedUnitReturnTo" HeaderText="Failed To" SortExpression="FailedUnitReturnTo" UniqueName="FailedUnitReturnTo" EditFormColumnIndex="2"> | |
| </telerik:GridDropDownColumn> | |
| <telerik:GridDropDownColumn DataField="Label1" HeaderText="Label1" EditFormColumnIndex="2"> | |
| </telerik:GridDropDownColumn> | |
| <telerik:GridDropDownColumn DataField="Label2" HeaderText="Label2" SortExpression="Label2" UniqueName="Label2" EditFormColumnIndex="3"> | |
| </telerik:GridDropDownColumn> | |
| <telerik:GridDropDownColumn DataField="Label3" HeaderText="Label3" SortExpression="Label3" UniqueName="Label3" EditFormColumnIndex="3"> | |
| </telerik:GridDropDownColumn> | |
| </Columns> | |
| <SortExpressions> | |
| <telerik:GridSortExpression FieldName="SeqNo" SortOrder ="Ascending" /> | |
| </SortExpressions> | |
| <EditFormSettings ColumnNumber="4" CaptionDataField="PCBA" CaptionFormatString="Edit properties of Product {0}"> | |
| <FormTableItemStyle Wrap="False"></FormTableItemStyle> | |
| <FormMainTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="3" BackColor="White" | |
| Width="100%" /> | |
| <FormTableStyle CellSpacing="0" CellPadding="2" Height="60px" | |
| BackColor="White" /> | |
| <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> | |
| <EditColumn ButtonType="ImageButton" | |
| InsertText="Insert Order" UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit"> | |
| </EditColumn> | |
| <FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle> | |
| </EditFormSettings> | |
| </MasterTableView> | |
| <FilterMenu EnableTheming="True"> | |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> | |
| </FilterMenu> | |
| </telerik:RadGrid> | |
| </td> | |
| </tr> | |
| <tr> | |
| <td align="center" ></td> | |
| <td width="500" align="left" ><asp:Button ID="Button5" runat="server" Text="Save" | |
| Font-Names="Verdana" CssClass="bButton" /> | |
| <asp:Button ID="Button6" runat="server" Text="Cancel" CssClass="bButton" /></td> | |
| <td align="center" ></td> | |
| </tr> | |
| </table></td> | |
| </tr> | |
| </table> | |
| Imports System.Data | |
| Imports Telerik.Web.UI | |
| Partial Class Module_FloorControl_AssemblyControl | |
| Inherits System.Web.UI.UserControl | |
| Dim eTraceWS As New eTraceReportService.Service | |
| Dim ds As New Data.DataSet | |
| Dim contorl As New Label | |
| Dim LabelModule As New Label | |
| Dim treeview As New Telerik.Web.UI.RadTreeView | |
| Dim Assembly As String | |
| Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load | |
| LabelModule = Me.Parent.Parent.FindControl("LabelMoudel") | |
| contorl = Me.Parent.Parent.FindControl("LabelName") | |
| treeview = Me.Parent.Parent.FindControl("ModuleTreeView") | |
| Assembly = contorl.Text | |
| ds = eTraceWS.GetAssemblyData(Assembly, treeview.SelectedNode.Text) | |
| RestScreen() | |
| End Sub | |
| Public Sub RestScreen() | |
| Dim process As New Telerik.Web.UI.GridDropDownColumn | |
| If Assembly <> "" Then | |
| Else | |
| ModelTxt.Text = treeview.SelectedNode.Text | |
| PCBATxt.Text = "" | |
| DescriptionTxt.Text = "" | |
| MotherBoardDdl.SelectedIndex = 0 | |
| MBCHK.Checked = False | |
| RemarksTxt.Text = "" | |
| End If | |
| End Sub | |
| Protected Sub RadGrid1_InsertCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.InsertCommand | |
| End Sub | |
| Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand | |
| End Sub | |
| Protected Sub RadGrid1_ItemInserted(ByVal source As Object, ByVal e As Telerik.Web.UI.GridInsertedEventArgs) Handles RadGrid1.ItemInserted | |
| End Sub | |
| Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource | |
| RadGrid1.DataSource = ds | |
| RadGrid1.DataMember = "Routing" | |
| RadGrid1.MasterTableView.DataSource = ds | |
| RadGrid1.MasterTableView.DataMember = "Routing" | |
| End Sub | |
| End Class |