<InsertItemTemplate> <asp:DropDownList ID="ddlGender" runat="server"> <asp:ListItem Text="Male" Value="Male"></asp:ListItem> <asp:ListItem Text="Female" Value="Female"></asp:ListItem> </asp:DropDownList> </InsertItemTemplate>
Dim selectColmn As New TreeListSelectColumn()
selectColmn =
New TreeListSelectColumn()
selectColmn.HeaderText =
"select"
selectColmn.UniqueName =
"select"
RadTreeList1.Columns.Add(selectColmn)
templateColumn =
New TreeListTemplateColumn()
templateColumn.HeaderText =
"Invoice #"
templateColumn.UniqueName = "inv_id"
templateColumn.ItemTemplate =
New InvTemplColumn(templateColumn.DataField)
RadTreeList1.Columns.Add(templateColumn)
After selecting few invoices I want to perform some actions like- export,print, for which I need inv_id of selected rows(inv_id is not visible in treelist), but I am not able to get inv_id of selected rows.Is there any option using which I can bind value to selectcolumn. Please let me know if you have any solution. It's very urgent.
Thanks in advance.
RadPane2 is hidden initially on my page. However, I have RadGrid1 in RadPane1, which is visible.
So when I select a row from RadGrid1, this causes the indexchanged event method to fire. RadPane2.Visible is set to True in that method and I populate the detail fields. Using the debugger, I see values going into those detail fields. Unfortunately, on my page RadPane2 does not refresh and show me those updated fields.
What am I missing? Any suggestions?
code:
----------------------------
public void RadDataGrid1_IndexChanged(object sender, EventArgs e) { RadGrid grid = (sender as RadGrid); if (grid != null && RadDataGrid1.SelectedIndexes.Count > 0) { int index = grid.SelectedIndexes[0].GetIntOrZeroIfError(); item = grid.Items[index];
// Detail fields lblDetail_Name.Text = item["Name"].Text;
lblDetail_Address.Text = item["Address"].Text;
RadPane2.Visible = true; } }
----------------------------
Thanks,
Tammie
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" /> <telerik:RadGrid ID="RadGrid1" Width="100%" AllowSorting="True" ShowFooter="True" OnPreRender="RadGrid1_PreRender" PageSize="15" AllowPaging="True" OnItemDataBound="RadGrid1_ItemDataBound" AllowMultiRowSelection="True" ShowChooser="true" EnableLinqExpressions="False" runat="server" GridLines="None" AutoGenerateColumns="False" CellSpacing="0" DataSourceID="SqlDataSource1"> <MasterTableView Width="100%" Summary="RadGrid table" RetrieveAllDataFields="false" DataSourceID="SqlDataSource1"> <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings> <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"> </RowIndicatorColumn> <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"> </ExpandCollapseColumn> <Columns> <telerik:GridBoundColumn DataField="ProductID" HeaderText="ProductID" DataType="System.Int32" SortExpression="ProductID" FilterControlAltText="Filter ProductID column" ReadOnly="True" UniqueName="ProductID"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="ID" HeaderText="ID" DataType="System.Int32" FilterControlAltText="Filter ID column" SortExpression="ID" UniqueName="ID"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="ProductName" HeaderText="ProductName" FilterControlAltText="Filter ProductName column" SortExpression="ProductName" UniqueName="ProductName"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Price" HeaderText="Price" SortExpression="Price" UniqueName="price"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Price2" HeaderText="Price2" SortExpression="Price2" UniqueName=Price2> </telerik:GridBoundColumn> </Columns> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"> </EditColumn> </EditFormSettings> </MasterTableView> <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle> <FilterMenu EnableImageSprites="False"> </FilterMenu> </telerik:RadGrid> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Rajeev_DBConnectionString %>" SelectCommand="SELECT * FROM [product]"></asp:SqlDataSource>using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using Business;using Telerik.Web.UI;namespace Telerik_Master_Pages{ public partial class TestSum : System.Web.UI.Page { Decimal total; Decimal total2; Decimal grantotal; protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem) { GridDataItem dataItem = e.Item as GridDataItem; Decimal fieldValue = Convert.ToDecimal(dataItem["Price"].Text); Decimal Fieldvalue2 = Convert.ToDecimal(dataItem["Price2"].Text); total += fieldValue; total2 += Fieldvalue2; // grantotal = fieldValue + Fieldvalue2; } if (e.Item is GridFooterItem) { grantotal = Convert.ToDecimal(total) + Convert.ToDecimal(total2); GridFooterItem footerItem = e.Item as GridFooterItem; footerItem["Price"].Text = "total: " + total.ToString(); footerItem["Price2"].Text = "total Price2: " + total2.ToString() + " " + " Grand Total " + grantotal; } } protected void RadGrid1_PreRender(object sender, EventArgs e) { } }}