or
<MasterTableView DataKeyNames="Title" AutoGenerateColumns="false" CommandItemDisplay="TopAndBottom" CommandItemSettings-AddNewRecordText="Add New Item" > <Columns> <telerik:GridTemplateColumn DataField="Title" HeaderText="Product Number" UniqueName="ProductNumber" Visible="true"> <InsertItemTemplate> <telerik:RadTextBox ID="RadtxtPrdNumber" runat="server" Text='<%# Bind("Title") %>' > </telerik:RadTextBox> </InsertItemTemplate> <EditItemTemplate> <telerik:RadTextBox ID="RadtxtPrdNumber" runat="server" Text='<%# Eval("Title") %>' > </telerik:RadTextBox> </EditItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="Description" HeaderText="Description" UniqueName="Description"Visible="true"> <InsertItemTemplate> <telerik:RadTextBox ID="RadtxtDescription" runat="server" Text='<%# Bind("Description") %>' > </telerik:RadTextBox> </InsertItemTemplate> <EditItemTemplate> <telerik:RadTextBox ID="RadtxtDescription" runat="server" Text='<%# Eval("Description") %>' > </telerik:RadTextBox> </EditItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView>In this example,it shows the value of the DateField to the ClientDataKeyNames array of the MasterTableView or a detail GridTableView, L:ikewise ,how to send image column
function RowSelected(sender, args) { var label = document.getElementById("<%= Label1.ClientID %>"); label.innerHTML = "<b>CustomerID: </b>" + args.getDataKeyValue("CustomerID") + "<br />" + "<b>CompanyName: </b>" + args.getDataKeyValue("CompanyName"); }
<telerik:RadToolBar ID="RadToolBar1" runat="server" Skin="Office2010Blue" OnButtonClick="RadToolBar1_ButtonClick" EnableRoundedCorners="true" EnableShadows="true" Width="100%"> <ExpandAnimation Type="OutQuart" Duration="300"></ExpandAnimation> <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> <Items> <telerik:RadToolBarButton> <ItemTemplate> <div style="margin: 0 5px 0 15px;width:620px;"> <asp:Label ID="lblCategory" runat="server" Text="CategotyText"></asp:Label> </div> </ItemTemplate> </telerik:RadToolBarButton> <telerik:RadToolBarDropDown Text="Sort"> <Buttons> <telerik:RadToolBarButton Text="New Arrivals"> </telerik:RadToolBarButton> <telerik:RadToolBarButton Text="Unordered"> </telerik:RadToolBarButton> </Buttons> </telerik:RadToolBarDropDown> </Items> </telerik:RadToolBar>
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Item As RadToolBarItem = RadToolBar1.Items(0)
Dim lbl As TextBox = TryCast(Item.FindControl("lblCategory"), TextBox)
lbl.Text = "Found"
End Sub
What am I doing wrong?
<script type="text/javascript"> var isDirty; isDirty = 0; function setDirty() { var form = document.getElementById("<%=txt.ClientID %>"); var v = form.value; //is_checked = elems[i].checked; //is_checked1 = elems[i].checked; if (v == '') { isDirty = 0; //alert("In"); } else { isDirty = 1; alert("In"); } } function checkSave() { var sSave; if (isDirty == 1) { sSave = window.confirm("You have some changes that have not been saved. Click OK to save now or CANCEL to continue without saving."); if (sSave == true) { } else { } } } </script><telerik:RadScriptManager runat="server" ID="RadScriptManager1"></telerik:RadScriptManager> <form id="Form1" method="post" runat="server"> <TABLE id="Table4" style="Z-INDEX: 101; LEFT: 40px; POSITION: absolute; TOP: 40px; BORDER-COLLAPSE: collapse" height="99%" cellSpacing="1" cellPadding="1" width="95%" border="0"> <TR> <TD vAlign="top" align="left"> <TABLE id="Table1" style="BORDER-COLLAPSE: collapse" cellSpacing="1" cellPadding="1" width="300" border="1"> <TR> <TD align="center" background="..\imagenes\titulos2.jpg"><asp:label id="Label3" runat="server" Height="100%" Width="474px" CssClass="text">Tipo de Carnet</asp:label></TD> </TR> <TR> <TD> <TABLE id="Table2" height="100%" cellSpacing="1" cellPadding="1" width="100%" border="0"> <TR> <TD noWrap><asp:label id="Label4" runat="server" CssClass="label1">Fecha Inicio</asp:label></TD> <TD style="WIDTH: 226px"> <cc1:livetextbox id="fechain" runat="server" CssClass="flat">10/09/2006</cc1:livetextbox><IMG id="Img2" onclick="javascript:fPopCalendar(fechain,fechain,1,4,'/')" alt="" src="..\imagenes\calendar.png"></TD> <TD noWrap><asp:label id="Label1" runat="server" CssClass="label1">Fecha Fin</asp:label></CC1:LIVELABEL></TD> <TD noWrap> <cc1:livetextbox id="fechafin" runat="server" CssClass="flat">10/09/2006</cc1:livetextbox><IMG id="Img1" onclick="javascript:fPopCalendar(fechafin,fechafin,1,4,'/')" alt="" src="..\imagenes\calendar.png"></TD> </TR> </TABLE> </TD> </TR> <TR> <TD><asp:button id="Button2" runat="server" CssClass="gridupdate" ToolTip="Aceptar" onclick="Button2_Click1"></asp:button> <asp:button id="Button1" runat="server" CssClass="excel" ToolTip="Exportar a Excel"></asp:button></TD> </TR> </TABLE> <telerik:radgrid id="RadGrid1" runat="server" ShowGroupPanel="True" AllowSorting="True" CssClass="Windows7" Skin="Windows7" > <PagerStyle CssClass="GridPager_Default" ></PagerStyle> <AlternatingItemStyle CssClass="GridAltRow_Default"></AlternatingItemStyle> <GroupHeaderItemStyle CssClass="GroupHeader_Default"></GroupHeaderItemStyle> <FilterMenu NotSelectedImageUrl="~/RadControls/Grid/Skins/Default/NotSelectedMenu.gif" HoverBackColor="LightSteelBlue" HoverBorderColor="Navy" SelectColumnBackColor="Control" SelectedImageUrl="~/RadControls/Grid/Skins/Default/SelectedMenu.gif" TextColumnBackColor="Window"></FilterMenu> <MasterTableView CssClass="MasterTable_Default"> <RowIndicatorColumn UniqueName="RowIndicator" Visible="False"> <HeaderStyle Width="20px" CssClass="ResizeHeader_Default"></HeaderStyle> <ItemStyle CssClass="ResizeItem_Default"></ItemStyle> </RowIndicatorColumn> <EditFormSettings> <EditColumn UniqueName="EditCommandColumn"></EditColumn> </EditFormSettings> <ExpandCollapseColumn ButtonType="ImageButton" UniqueName="ExpandColumn" Visible="False"> <HeaderStyle Width="19px"></HeaderStyle> </ExpandCollapseColumn> </MasterTableView> <HeaderStyle CssClass="GridHeader_Default"></HeaderStyle> <SelectedItemStyle CssClass="SelectedRow_Default"></SelectedItemStyle> <ActiveItemStyle CssClass="ActiveRow_Default"></ActiveItemStyle> <ItemStyle CssClass="GridRow_Default"></ItemStyle> <FooterStyle CssClass="GridFooter_Default"></FooterStyle> <ClientSettings AllowExpandCollapse="True" AllowRowHide="True" AllowDragToGroup="True" AllowGroupExpandCollapse="True"> <Resizing AllowColumnResize="True"></Resizing> </ClientSettings> <GroupPanel Visible="True"> <PanelStyle CssClass="GroupPanel_Default"></PanelStyle> <PanelItemsStyle CssClass="GroupPanelItems_Default"></PanelItemsStyle> </GroupPanel> </telerik:radgrid></TD> </TR> <TR> <TD vAlign="bottom" align="right"><cc1:liveimage id="LiveImage1" runat="server" Height="218px" Width="305px" ImageUrl="..\imagenes\fondo2.jpg"></cc1:liveimage></TD> </TR> </TABLE> </form>private void Page_Load(object sender, System.EventArgs e) { if(!IsPostBack) { this.fechain.Text="01"+DateTime.Now.ToString("/MMM/yyyy"); this.fechafin.Text=DateTime.Now.ToString("dd/MMM/yyyy"); GridGroupByExpression expression = new GridGroupByExpression(); GridGroupByField gridGroupByField = new GridGroupByField(); gridGroupByField = new GridGroupByField(); gridGroupByField.FieldName = "EMPRESA"; gridGroupByField.HeaderText = "Empresa"; gridGroupByField.HeaderValueSeparator = " "; gridGroupByField.FormatString = "<strong>{0}</strong>"; expression.SelectFields.Add( gridGroupByField ); gridGroupByField = new GridGroupByField(); gridGroupByField.FieldName = "CODIGO"; gridGroupByField.HeaderText = "Empleados"; gridGroupByField.Aggregate = GridAggregateFunction.Count; expression.SelectFields.Add( gridGroupByField ); gridGroupByField = new GridGroupByField(); gridGroupByField.FieldName = "Total"; gridGroupByField.HeaderText = "Costo "; gridGroupByField.HeaderValueSeparator = ""; gridGroupByField.FormatString ="{0:C}"; gridGroupByField.Aggregate = GridAggregateFunction.Sum; expression.SelectFields.Add( gridGroupByField ); //Add a filed for group-by (after the "Group By" clause) gridGroupByField = new GridGroupByField(); gridGroupByField.FieldName = "EMPRESA"; expression.GroupByFields.Add( gridGroupByField ); this.RadGrid1.MasterTableView.GroupByExpressions.Add( expression ); GridGroupByExpression expression1 = new GridGroupByExpression(); GridGroupByField gridGroupByField1 = new GridGroupByField(); gridGroupByField1 = new GridGroupByField(); gridGroupByField1.FieldName = "DEPARTAMENTO"; gridGroupByField1.HeaderText = "Departamento"; gridGroupByField1.HeaderValueSeparator = " "; gridGroupByField1.FormatString = "<strong>{0}</strong>"; expression1.SelectFields.Add( gridGroupByField1 ); gridGroupByField1 = new GridGroupByField(); gridGroupByField1.FieldName = "CODIGO"; gridGroupByField1.HeaderText = "Empleados"; gridGroupByField1.Aggregate = GridAggregateFunction.Count; expression1.SelectFields.Add( gridGroupByField1 ); gridGroupByField = new GridGroupByField(); gridGroupByField.FieldName = "Total"; gridGroupByField.HeaderText = "Costo "; gridGroupByField.HeaderValueSeparator = ""; gridGroupByField.FormatString ="{0:C}"; gridGroupByField.Aggregate = GridAggregateFunction.Sum; expression1.SelectFields.Add( gridGroupByField ); //Add a filed for group-by (after the "Group By" clause) gridGroupByField = new GridGroupByField(); gridGroupByField.FieldName = "DEPARTAMENTO"; expression1.GroupByFields.Add( gridGroupByField ); this.RadGrid1.MasterTableView.GroupByExpressions.Add( expression1 ); GridGroupByExpression expression2 = new GridGroupByExpression(); GridGroupByField gridGroupByField2 = new GridGroupByField(); gridGroupByField2 = new GridGroupByField(); gridGroupByField2.FieldName = "CARNET"; gridGroupByField2.HeaderText = "Carnet"; gridGroupByField2.HeaderValueSeparator = " "; gridGroupByField2.FormatString = "<strong>{0}</strong>"; expression2.SelectFields.Add( gridGroupByField2 ); gridGroupByField2 = new GridGroupByField(); gridGroupByField2.FieldName = "CODIGO"; gridGroupByField2.HeaderText = "Empleado_Carnets"; gridGroupByField2.Aggregate = GridAggregateFunction.Count; expression2.SelectFields.Add( gridGroupByField2 ); gridGroupByField = new GridGroupByField(); gridGroupByField.FieldName = "Total"; gridGroupByField.HeaderText = "Costo "; gridGroupByField.HeaderValueSeparator = ""; gridGroupByField.FormatString ="{0:C}"; gridGroupByField.Aggregate = GridAggregateFunction.Sum; expression2.SelectFields.Add( gridGroupByField ); //Add a filed for group-by (after the "Group By" clause) gridGroupByField = new GridGroupByField(); gridGroupByField.FieldName = "CARNET"; expression2.GroupByFields.Add( gridGroupByField ); this.RadGrid1.MasterTableView.GroupByExpressions.Add( expression2 ); GridGroupByExpression expression3 = new GridGroupByExpression(); GridGroupByField gridGroupByField3 = new GridGroupByField(); gridGroupByField3 = new GridGroupByField(); gridGroupByField3.FieldName = "JORNADA"; gridGroupByField3.HeaderText = "Jornada"; gridGroupByField3.HeaderValueSeparator = " "; gridGroupByField3.FormatString = "<strong>{0}</strong>"; expression3.SelectFields.Add( gridGroupByField3 ); gridGroupByField3 = new GridGroupByField(); gridGroupByField3.FieldName = "CODIGO"; gridGroupByField3.HeaderText = "Empleados_Tipo"; gridGroupByField3.Aggregate = GridAggregateFunction.Count; expression3.SelectFields.Add( gridGroupByField3 ); gridGroupByField = new GridGroupByField(); gridGroupByField.FieldName = "Total"; gridGroupByField.HeaderText = "Costo "; gridGroupByField.HeaderValueSeparator = ""; gridGroupByField.FormatString ="{0:C}"; gridGroupByField.Aggregate = GridAggregateFunction.Sum; expression3.SelectFields.Add( gridGroupByField ); //Add a filed for group-by (after the "Group By" clause) gridGroupByField = new GridGroupByField(); gridGroupByField.FieldName = "JORNADA"; gridGroupByField.SortOrder=Telerik.Web.UI.GridSortOrder.Ascending; expression3.GroupByFields.Add( gridGroupByField ); this.RadGrid1.MasterTableView.GroupByExpressions.Add( expression3 ); this.RadGrid1.MasterTableView.GroupsDefaultExpanded=false; } }