Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
98 views
Hi,

I am displaying/inserting/deleting/updating on a RadGrid. Two of the columns are from the two different tables. I am displaying these two columns in Griddropdowncolumn when an insert/edit operations perform.

Table-1(Divisions) columns :   (PK)Division_ID, Division_Name
Table-2(Sections) Columns :   Section_ID, Section_Name, Division_ID(FK)


Table1(Divisions)              Table2(Sections)
----------------------              ----------------------
Mobile  ------------------------>Nokia
            ------------------------>Ericsson
            ------------------------>Samsug
            ------------------------>Motorola

Pens    ------------------------>rotomax
            ------------------------>calibur
            ------------------------>Halliburton

I am able to display all division in Griddropdownand all sections in another GridDropDown.  

What i need is when division mobile is selected, only  values from the mobile sections will have to display.

Please find the following code:
--------------------------------------------------------------------
<div style="text-align: center;">
        <span style="font-family: Arial; font-size: larger;">Resource Information<br />
            <br />
        </span>
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
            AllowAutomaticUpdates="True" AllowFilteringByColumn="True" AllowPaging="True"
            AllowSorting="True" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True"
            DataSourceID="SqlDataSource1" GridLines="None" ShowGroupPanel="True" Skin="Vista">
            <MasterTableView AutoGenerateColumns="False" CellSpacing="-1" CommandItemDisplay="TopAndBottom"
                DataKeyNames="Resource_ID" DataSourceID="SqlDataSource1" EditMode="PopUp">
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="Resource_ID" DataType="System.Int32" HeaderText="Resource_ID"
                        ReadOnly="True" SortExpression="Resource_ID" UniqueName="Resource_ID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Resource_Name" HeaderText="Resource_Name" SortExpression="Resource_Name"
                        UniqueName="Resource_Name">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Resource_Designation" HeaderText="Resource_Designation"
                        SortExpression="Resource_Designation" UniqueName="Resource_Designation">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Resource_EMail" HeaderText="Resource_EMail" SortExpression="Resource_EMail"
                        UniqueName="Resource_EMail">
                    </telerik:GridBoundColumn>
                    <telerik:GridDropDownColumn DataField="Division_ID" DataSourceID="SqlDataSource2"
                        HeaderText="Division" ListTextField="Division_Name" ListValueField="Division_ID"
                        DataType="System.Int32" UniqueName="UniqueDivisionName">
                    </telerik:GridDropDownColumn>
                    <telerik:GridDropDownColumn DataField="Section_ID" DataSourceID="SqlDataSource3"
                        HeaderText="Section" ListTextField="Section_Name" ListValueField="Section_ID"
                        DataType="System.Int32" UniqueName="UniqueSectionName">
                    </telerik:GridDropDownColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings AllowDragToGroup="True">
            </ClientSettings>
        </telerik:RadGrid><br />
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ResourceUtilizationDBConnectionString %>"
            SelectCommand="SELECT * FROM [Resource_Information]" ConflictDetection="CompareAllValues"
            DeleteCommand="DELETE FROM [Resource_Information] WHERE [Resource_ID] = @original_Resource_ID AND (([Resource_Name] = @original_Resource_Name) OR ([Resource_Name] IS NULL AND @original_Resource_Name IS NULL)) AND (([Resource_Designation] = @original_Resource_Designation) OR ([Resource_Designation] IS NULL AND @original_Resource_Designation IS NULL)) AND (([Resource_EMail] = @original_Resource_EMail) OR ([Resource_EMail] IS NULL AND @original_Resource_EMail IS NULL)) AND (([Division_ID] = @original_Division_ID) OR ([Division_ID] IS NULL AND @original_Division_ID IS NULL)) AND (([Section_ID] = @original_Section_ID) OR ([Section_ID] IS NULL AND @original_Section_ID IS NULL))"
            InsertCommand="INSERT INTO [Resource_Information] ([Resource_Name], [Resource_Designation], [Resource_EMail], [Division_ID], [Section_ID]) VALUES (@Resource_Name, @Resource_Designation, @Resource_EMail, @Division_ID, @Section_ID)"
            OldValuesParameterFormatString="original_{0}" UpdateCommand="UPDATE [Resource_Information] SET [Resource_Name] = @Resource_Name, [Resource_Designation] = @Resource_Designation, [Resource_EMail] = @Resource_EMail, [Division_ID] = @Division_ID, [Section_ID] = @Section_ID WHERE [Resource_ID] = @original_Resource_ID AND (([Resource_Name] = @original_Resource_Name) OR ([Resource_Name] IS NULL AND @original_Resource_Name IS NULL)) AND (([Resource_Designation] = @original_Resource_Designation) OR ([Resource_Designation] IS NULL AND @original_Resource_Designation IS NULL)) AND (([Resource_EMail] = @original_Resource_EMail) OR ([Resource_EMail] IS NULL AND @original_Resource_EMail IS NULL)) AND (([Division_ID] = @original_Division_ID) OR ([Division_ID] IS NULL AND @original_Division_ID IS NULL)) AND (([Section_ID] = @original_Section_ID) OR ([Section_ID] IS NULL AND @original_Section_ID IS NULL))">
            <DeleteParameters>
                <asp:Parameter Name="original_Resource_ID" Type="Int32" />
                <asp:Parameter Name="original_Resource_Name" Type="String" />
                <asp:Parameter Name="original_Resource_Designation" Type="String" />
                <asp:Parameter Name="original_Resource_EMail" Type="String" />
                <asp:Parameter Name="original_Division_ID" Type="Int32" />
                <asp:Parameter Name="original_Section_ID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="Resource_Name" Type="String" />
                <asp:Parameter Name="Resource_Designation" Type="String" />
                <asp:Parameter Name="Resource_EMail" Type="String" />
                <asp:Parameter Name="Division_ID" Type="Int32" />
                <asp:Parameter Name="Section_ID" Type="Int32" />
                <asp:Parameter Name="original_Resource_ID" Type="Int32" />
                <asp:Parameter Name="original_Resource_Name" Type="String" />
                <asp:Parameter Name="original_Resource_Designation" Type="String" />
                <asp:Parameter Name="original_Resource_EMail" Type="String" />
                <asp:Parameter Name="original_Division_ID" Type="Int32" />
                <asp:Parameter Name="original_Section_ID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="Resource_Name" Type="String" />
                <asp:Parameter Name="Resource_Designation" Type="String" />
                <asp:Parameter Name="Resource_EMail" Type="String" />
                <asp:Parameter Name="Division_ID" Type="Int32" />
                <asp:Parameter Name="Section_ID" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ResourceUtilizationDBConnectionString %>"
            SelectCommand="SELECT [Division_ID], [Division_Name] FROM [NSS_Divisions]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ResourceUtilizationDBConnectionString %>"
            SelectCommand="SELECT [Section_ID], [Section_Name] FROM [Division_Sections]"></asp:SqlDataSource>
    </div>
---------------------------------------------------------


Thanks.

Regards
Arshad





              
Shinu
Top achievements
Rank 2
 answered on 06 May 2009
1 answer
127 views
Hi

I have a question.
For example, my grid have 2 columns ID and Title and radgrid filtering enable. When page load I want filtering Title columns. 

radgrid1.columns..[index]...="My Title";

thank you


 
Princy
Top achievements
Rank 2
 answered on 06 May 2009
3 answers
420 views
I have a page set up with a RadAjaxManager in which I have a javascript call that utilizes the ajaxRequest client-side method.  The operation works fine, but upon clicking the link that fires that javascript, the loading panel does not display.  Is the loading panel not supported for a client-side request?

Josh
Dimo
Telerik team
 answered on 06 May 2009
1 answer
147 views
Hello,

I have got a grid. To create its footer I use a PagerTemplate. This is the code of my grid:

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"
 
        <script type="text/javascript"
            var tableView = null
            function pageLoad(sender, args) { 
                tableView = $find("<%= grdMaestro.ClientID %>").get_masterTableView(); 
            } 
 
            function RadComboBox1_SelectedIndexChanged(sender, args) { 
                tableView.set_pageSize(sender.get_value()); 
            } 
 
            function changePage(argument) { 
                tableView.page(argument); 
            } 
 
            function RadNumericTextBox1_ValueChanged(sender, args) { 
                tableView.page(sender.get_value()); 
            } 
            function PaginaDetalles(sender, eventArgs) { 
                window.location = "fweDetalle.aspx"
            } 
        </script> 
         
    </telerik:RadScriptBlock> 
<asp:XmlDataSource ID="dsDatosMaestro" runat="server" DataFile="~/_Xml/DatosMaestro.xml"></asp:XmlDataSource> 
        <telerik:RadGrid ID="grdMaestro" runat="server" DataSourceID="dsDatosMaestro" AutoGenerateColumns="false"  
            AllowPaging="True" EnableEmbeddedSkins="False"  Skin="OT" GridLines="Vertical" AllowMultiRowSelection="true" 
            ><%-- OnItemDataBound="grdMaestro_ItemDataBound" --%>     
            <PagerStyle Mode="NextPrev" PageButtonCount="5" PagerTextFormat="{4} &nbsp; Nº Registros: <strong>{5}</strong>"  
            FirstPageToolTip="Primera página" PrevPageToolTip="Página anterior" NextPageToolTip="Siguiente página" LastPageToolTip="Última página" /> 
            <MasterTableView CellSpacing="-1"
                <Columns> 
                    <telerik:GridClientSelectColumn UniqueName="SelectColumn"
                        <HeaderStyle width="25px" /> 
                        <ItemStyle HorizontalAlign="Center"  /> 
                    </telerik:GridClientSelectColumn> 
                    <telerik:GridBoundColumn DataField="Código" HeaderText="Código" SortExpression="Código" UniqueName="Código"
                        <ItemStyle HorizontalAlign="Right" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Nombre" HeaderText="Nombre" SortExpression="Nombre" UniqueName="Nombre"
                        <ItemStyle HorizontalAlign="Left" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Fecha" HeaderText="Fecha" SortExpression="Fecha" UniqueName="Fecha"
                        <ItemStyle HorizontalAlign="Center" /> 
                    </telerik:GridBoundColumn> 
                </Columns> 
                <PagerTemplate> 
                    <span style="margin-top: 8px; margin-right: 5px; float: right;"
                        <asp:Label ID="lblRegistro" runat="server" Text="Nº Registros: "></asp:Label>  
                        <%# DataBinder.Eval(Container, "Paging.DataSourceCount")%> 
                    </span> 
                    <style="margin: 0px;margin-top:3px; padding: 0px;float:left;margin-right:10px"
                        <asp:Button ID="btn1" runat="server" OnClientClick="changePage('first'); return false;" 
                            CommandName="Page" CommandArgument="Primero" CssClass="PagerButton FirstPage" /> 
                        <asp:Button ID="btn2" runat="server" OnClientClick="changePage('prev'); return false;" 
                            CommandName="Page" CommandArgument="Previo" CssClass="PagerButton PrevPage" /> 
                        <span style="vertical-align: middle;"
                            <asp:Label ID="lblPagina" runat="server" Text="Página:" /> 
                        </span> 
                        <telerik:RadNumericTextBox ID="RadNumericTextBox1" Skin="Office2007" Width="25px" 
                            Value='<%# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %>' 
                            runat="server"
                            <ClientEvents OnValueChanged="RadNumericTextBox1_ValueChanged" /> 
                            <NumberFormat DecimalDigits="0" /> 
                        </telerik:RadNumericTextBox> 
                        <span style="vertical-align: middle;"
                        <asp:Label ID="Label1" runat="server" Text="de"></asp:Label> 
                        <%# DataBinder.Eval(Container, "Paging.PageCount")%> 
                        </span> 
                        <asp:Button ID="btn3" runat="server" OnClientClick="changePage('next'); return false;" 
                            CommandName="Page" CommandArgument="Siguiente" CssClass="PagerButton NextPage" /> 
                        <asp:Button ID="btn4" runat="server" OnClientClick="changePage('last'); return false;" 
                            CommandName="Page" CommandArgument="Ultimo" CssClass="PagerButton LastPage" /> 
                        <asp:Panel runat="server" ID="NumericPagerPlaceHolder" > </asp:Panel> 
                     </p>  
                </PagerTemplate> 
            </MasterTableView> 
            <ClientSettings EnableRowHoverStyle="true"
                <Selecting AllowRowSelect="True" /> 
                <ClientMessages /> 
                <ClientEvents OnRowDblClick="PaginaDetalles" /> 
            </ClientSettings>    
        </telerik:RadGrid>  

I don´t know if you have noticed but pagertemplate is taken from your online demos jeje.

My problem is that tooltips are not shown.

do you know why?

thank you in advance.
Princy
Top achievements
Rank 2
 answered on 06 May 2009
0 answers
110 views

HI,

i use the RadTreeView with Checkboxes.

My Problem is the function "treeView.CheckedNodes" because the Return - Object is a IList<RadTreeNode>.

Sample Code:

       

 private void ShowCheckedNodes(RadTreeView treeView)  
        {  
             
 
            IList<RadTreeNode> nodeCollection = treeView.CheckedNodes;  
            foreach (RadTreeNode node in nodeCollection)  
            {  
                string x = node.FullPath;  
                 
            }  
             
        } 

What i need is a RadTreeNodeCollection as result. Let me describe in more detail:
What's important for me is the structure of the TreeView object, but only the selected nodes.

How can I achieve this?

Laz
Top achievements
Rank 1
 asked on 06 May 2009
1 answer
117 views

Hi, Iam having a scenario like this

on my webform I am having a combobox, a uploading file control,a Add button and a radGrid(it is having two columns combobox value column and fileNmae) .
In my combobox it is having some values (say A,B and C), I select a value from combobox and against that I browse for a file, after browsing a file when I click on Add button the combox value and the file path which is browsed should appear in radGrid.
How could I achieve this and one more thing one combobox selected value can have multiple files against them.

my source code is as follows :

<p><asp:Label ID="lblDocName" Text="Document Name" runat="server" /></p>
    <p><radG:RadComboBox ID="ddlDocName" runat="server" /></p>
    </div>
    <div>
    <p><asp:Label ID="lblAttachDoc" Text="Attach Document" runat="server" /></p>
    <p><asp:FileUpload ID="uplFileAttach" runat="server" Width="200px" /></p>
    </div>
    </div>
   
   
    <div >
    <asp:Button  ID="btnAdd" Text="Add" runat="server" />
    </div>
   
    
    <div>
    <radG:RadGrid ID="rgDocument" runat="server" Skin="Default" EnableEmbeddedSkins="False" Width="570px"  GridLines="None">
        <MasterTableView>
            <NoRecordsTemplate>
            </NoRecordsTemplate>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
            <RowIndicatorColumn>
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
        </MasterTableView>
     </radG:RadGrid>
    </div>


thanks,

Princy
Top achievements
Rank 2
 answered on 06 May 2009
1 answer
64 views
When I set a RadNumericTextbox to showSpinButtons = true, all of a sudden the whole control dissapears when I am in IE8 comatibility view! When select IE7, firefox or IE8 non compatibility view, it works just fine but just that one view!!

What do I need to do??? I am currently using Telerik.Web.UI version 2009.1.402.35. Is this a known issue? When will it be fixed?
Thanks


Dimo
Telerik team
 answered on 06 May 2009
1 answer
203 views
Hi
i want to bind a datasource to a Griddropdown column but when i bind it , but i face with some error like that reference to null object
here is my Aspx code:
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_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>Untitled Page</title> 
    <style type="text/css"
 
 
.RadGrid_Default 
    border:1px solid #232323; 
 
.RadGrid_Default 
    font:11px/1.4 arial,sans-serif; 
 
.RadGrid_Default 
    background:#d4d0c8; 
    color:#333; 
 
.MasterTable_Default 
    background:#fff; 
    border-collapse:separate !important; 
 
.MasterTable_Default 
    font:11px/1.4 arial,sans-serif; 
 
.GridHeader_Default 
    color:#fff; 
    text-decoration:none; 
 
.GridHeader_Default 
    border-bottom:1px solid #010101; 
    background:url('mvwres://Telerik.Web.UI, Version=2008.3.1105.35, Culture=neutralPublicKeyToken=121fae78165ba3d4/Telerik.Web.UI.Skins.Default.Grid.headers.gif') repeat-x #434343; 
    padding:10px 6px 10px 11px; 
    text-align:left; 
    font-size:1.3em; 
    font-weight:normal; 
 
.GridHeader_Default a 
    color:#fff; 
    text-decoration:none; 
 
.RadGrid_Default .rgFilter 
    background-position:2px -897px; 
 
.RadGrid_Default .rgFilter 
    width:16px; 
    height:16px; 
    border:0; 
    padding:0; 
    background-color:transparent; 
    background-image:url('mvwres://Telerik.Web.UI, Version=2008.3.1105.35, Culture=neutralPublicKeyToken=121fae78165ba3d4/Telerik.Web.UI.Skins.Default.Grid.sprite.gif'); 
    background-repeat:no-repeat; 
    vertical-align:middle; 
    cursor:pointer; 
 
    </style> 
</head> 
<body> 
    <form id="form1" runat="server"
    <div> 
     
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
        </telerik:RadAjaxManager> 
     
    </div> 
    <asp:ScriptManager ID="ScriptManager1" runat="server"
    </asp:ScriptManager> 
    <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None"  
        onprerender="RadGrid1_PreRender"
<HeaderContextMenu EnableTheming="True"
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
</HeaderContextMenu> 
 
<MasterTableView AutoGenerateColumns="False" DataKeyNames="source_code,source_row"
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
    <Columns> 
        <telerik:GridBoundColumn DataField="source_code" DataType="System.Decimal"  
            HeaderText="source_code" ReadOnly="True" SortExpression="source_code"  
            UniqueName="source_code"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="source_row" DataType="System.Decimal"  
            HeaderText="source_row" ReadOnly="True" SortExpression="source_row"  
            UniqueName="source_row"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="activity_id" DataType="System.Decimal"  
            HeaderText="activity_id" SortExpression="activity_id" UniqueName="activity_id"
        </telerik:GridBoundColumn>       
        <telerik:GridDropDownColumn UniqueName="source_desc" DataSourceID="SqlDataSource1" 
                        SortExpression="source_desc" ListTextField="lookup_nm" ListValueField="lookup_cd" 
                        HeaderText="Title of courtesy" DataField="source_desc" DropDownControlType="RadComboBox"  > 
                    </telerik:GridDropDownColumn> 
    </Columns> 
</MasterTableView> 
 
<FilterMenu EnableTheming="True"
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
</FilterMenu> 
    </telerik:RadGrid> 
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"  
        ConnectionString="<%$ ConnectionStrings:OrdersConnectionString %>"  
        SelectCommand="SELECT [lookup_cd], [lookup_nm] FROM [PB_lookup] WHERE ([lookup_id] = 'PB_source_header.company_typ_id')"
        <SelectParameters> 
            <asp:Parameter Name="lookup_id" Type="String" /> 
        </SelectParameters> 
    </asp:SqlDataSource> 
    </form> 
</body> 
</html> 
 
and here is my Cs code:
public partial class _Default : System.Web.UI.Page  
    protected void Page_Load(object sender, EventArgs e) 
    { 
        RadGrid1.MasterTableView.CommandItemDisplay = Telerik.Web.UI.GridCommandItemDisplay.TopAndBottom; 
        DataSet ds = new DataSet(); 
        SqlCommand cmd = new SqlCommand("Select * From PB_source_detail"); 
        SqlConnection mycon = new SqlConnection("Data Source=MONO-PC\\SQLEXPRESS;Initial Catalog=Orders;Integrated Security=True"); 
        mycon.Open(); 
        SqlDataAdapter SDA = new SqlDataAdapter(cmd.CommandText, mycon); 
        SDA.Fill(ds); 
        RadGrid1.DataSource = ds.Tables[0]; 
        mycon.Close(); 
 
    }   
}}
Do u know why?
Yavor
Telerik team
 answered on 06 May 2009
7 answers
400 views
New to Radgrid and we are doing an evaluation.  We have a table that is approximately 10,000 records, and each record has  approximately 30 fields.  This grid is read only and all of the columns are GridBoundColumns.  It takes approximately 30 secs for the grid to appear, and then it takes it an additional 2-3 secs to redraw.  We have watched the Telerik TV video re optimizing grid performance with only little noticeable increases in peformance.

How can we get the grid to come up faster.

Thanks in advance for a response.

John
Sebastian
Telerik team
 answered on 06 May 2009
3 answers
93 views
Is the R1 version supported yet? I read somewhere that only ASP.NET MVC Beta 1 is supported.

regards
Mathias Fritsch


Ivo
Telerik team
 answered on 06 May 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?