I have a collection of key value pairs
or
I can say details of a single person
or
a single record from a table in a database
I have to show them in a table.
(I cant use grid as such)
because my data have a lay out like given bellow
Full name :Alen
Total balance leave :100
Leave taken :3
Leave waiting approval :8
Leave remaining :89
Can i configure a Rad grid to show such a data?
if not which rad control i use to show a data as given above?
This is a bit urgent case for me.
I would like to have good look and feel like grid for the table too that is why I am contacting telerik
| <asp:TemplateField HeaderText="aaaHeader"> |
| <ItemTemplate> |
| <asp:Label ID="aaaLabel" runat="server" /> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <telerik:RadComboBox ID="aaaBox" Width="50px" runat="server" MarkFirstMatch="true" |
| AllowCustomText="false"> |
| </telerik:RadComboBox> |
| </EditItemTemplate> |
| </asp:TemplateField> |
| <CommandItemTemplate> |
| <telerik:RadToolBar runat="server" ID="GridCommandItemToolbar" AutoPostBack="false" Skin="WebBlue" |
| OnClientButtonClicked="ToolBarButtonClicked" Style="width: 100%" Visible="true"> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| <Items> |
| <telerik:RadToolBarButton runat="server" Enabled="false" ToolTip="Add Document" Value="AddDocument" ImageUrl="~/Images/Office/document_file/png/16/document_add_16x16.png"> |
| </telerik:RadToolBarButton> |
| <telerik:RadToolBarButton runat="server" Enabled="false" ToolTip="Edit Document" Value="EditDocument" ImageUrl="~/Images/Office/document_file/png/16/document_edit_16x16.png"> |
| </telerik:RadToolBarButton> |
| <telerik:RadToolBarButton runat="server" Enabled="false" ToolTip="Delete Document" Value="DeleteDocument" ImageUrl="~/Images/Office/document_file/png/16/document_delete_16x16.png"> |
| </telerik:RadToolBarButton> |
| <telerik:RadToolBarButton runat="server" IsSeparator="true"></telerik:RadToolBarButton> |
| <telerik:RadToolBarButton runat="server" Enabled="false" ToolTip="View Document History" Value="ViewHistory" CheckOnClick="true" Checked="false" AllowSelfUnCheck="true" ImageUrl="~/Images/Office/document_file/png/16/document_properties_16x16.png"> |
| </telerik:RadToolBarButton> |
| </Items> |
| </telerik:RadToolBar> |
| </CommandItemTemplate> |
| var tb = $find("<%= GridCommandItemToolbar.ClientID %>"); |
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication4._Default" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title></title> |
| <script type="text/javascript"> |
| function RadGrid1_Command(sender, args) { |
| var mtv = args.get_tableView(); |
| for (var i = 0, j = mtv.get_columns().length; i < j; i++) { |
| if (mtv.get_columns()[i].Display) |
| mtv.get_columns()[i].Display = null; |
| } |
| } |
| </script> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <div> |
| <asp:ScriptManager ID="ScriptManager" runat="server" AsyncPostBackTimeout="1000" |
| ScriptMode="Release"> |
| </asp:ScriptManager> |
| <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True" |
| AllowMultiColumnSorting="False" AutoGenerateColumns="False" Width="100%" AllowMultiRowSelection="True" |
| Height="565px" PageSize="20" ShowStatusBar="True" BorderWidth="1px" GridLines="Vertical"> |
| <MasterTableView EnableHeaderContextMenu="true"> |
| <Columns> |
| <telerik:GridBoundColumn DataField="NUMBERS" HeaderText="NUMBERS" UniqueName="NUMBERS"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="LETTERS" HeaderText="LETTERS" UniqueName="LETTERS"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="WORDS" HeaderText="WORDS" UniqueName="WORDS"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings AllowColumnsReorder="true" ColumnsReorderMethod="Reorder" ReorderColumnsOnClient="true"> |
| <ClientEvents OnCommand="RadGrid1_Command" /> |
| <Scrolling AllowScroll="True" UseStaticHeaders="True" /> |
| <Resizing AllowColumnResize="true" /> |
| <Selecting AllowRowSelect="true" /> |
| <DataBinding Location="~/TestService.asmx" SelectMethod="GetData"> |
| </DataBinding> |
| </ClientSettings> |
| </telerik:RadGrid> |
| </div> |
| </form> |
| <script type="text/javascript"> |
| var RadGrid1_ClientId = "<%= RadGrid1.ClientID %>"; |
| </script> |
| </body> |
| </html> |
| [WebService(Namespace = "http://tempuri.org/")] |
| [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] |
| [ScriptService] |
| [System.ComponentModel.ToolboxItem(false)] |
| public class TestService : System.Web.Services.WebService { |
| [WebMethod(EnableSession = true)] |
| public Dictionary<string, object> GetData(int startRowIndex, int maximumRows, List<GridSortExpression> sortExpression, List<GridFilterExpression> filterExpression) { |
| Dictionary<string, object> data = new Dictionary<string, object>(); |
| List<object> rows = new List<object>(); |
| for (int i = 0; i < 100; i++) { |
| rows.Add(new { |
| NUMBERS = i, |
| LETTERS = "A", |
| WORDS = "One" |
| }); |
| rows.Add(new { |
| NUMBERS = i, |
| LETTERS = "B", |
| WORDS = "Two" |
| }); |
| rows.Add(new { |
| NUMBERS = i, |
| LETTERS = "C", |
| WORDS = "Three" |
| }); |
| rows.Add(new { |
| NUMBERS = i, |
| LETTERS = "D", |
| WORDS = "Four" |
| }); |
| rows.Add(new { |
| NUMBERS = i, |
| LETTERS = "E", |
| WORDS = "Five" |
| }); |
| rows.Add(new { |
| NUMBERS = i, |
| LETTERS = "F", |
| WORDS = "Six" |
| }); |
| } |
| data.Add("Count", rows.Count); |
| int numElements = maximumRows; |
| if (maximumRows > (rows.Count - startRowIndex)) { |
| maximumRows = rows.Count - startRowIndex; |
| } |
| var tmpData = rows.GetRange(startRowIndex, maximumRows); |
| data.Add("Data", tmpData); |
| return data; |
| } |
| } |
RadTreeView treeView1 = (RadTreeView)RadCombobox2.Controls[2].FindControl("RadTreeCombo");
RadCombobox2.Text = treeView1.SelectedNode.Text;
I can see that text is added to the combobox , when i keep break point.
But when the page is displayed iam not able to see the value in the comobox.
Do i need to write any other events for this.
Pls help me out........
Regards,
Asra