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

i have two radcombobox which are related to each other,i am binding the second combox based on 1st combobox,but i want to display the default text to "ALL" when 2nd loads with data.how can i do that?

Thanks
Princy
Top achievements
Rank 2
 answered on 25 Jul 2011
1 answer
91 views
Hi,

I have a page on which there are multiple tabs. Validations are checked on all tabs before you finally click Submit button on main page.
Now in one of the tabs I have radgrid which user should be allowed to edit at all times.
I'm able to make all items Editable on Edit command. But when I try to update it; it checks for all page validations.
Is there any way to set CausesValidation property to false for it or skip all the validations and update grid only?

I even followed below approach, Skipping valiadation was achieved but its not going inside 'image_Click' even after clicking on it.
protected void rgRequest_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridDataItem && e.Item.IsInEditMode)
            {
                GridDataItem item = (GridDataItem)e.Item;
                ImageButton image = (ImageButton)e.Item.FindControl("UpdateButton");
                image.CausesValidation = false;
                image.Click += new ImageClickEventHandler(image_Click);
            }
        }
Thanks.
Sebastian
Telerik team
 answered on 25 Jul 2011
3 answers
362 views
Do you have an example that doing the same thing as http://www.telerik.com/help/aspnet-ajax/ajax-show-loadingpanel-on-initial-pageload.html, but there are there are several user controls on the page (tab/pageview).

I think this should use radajaxmanagerproxy?  I have read http://www.telerik.com/help/aspnet-ajax/ajax-ajaxmanagerproxy.html but can't make it work. Can you give a code example for showing loading panel on initial pageload while there are several user control's on the page, tab/pageview, when each tab clicks - new page loads and the ajax loading panel needs to show on initial pageload

Thanks!
Maria Ilieva
Telerik team
 answered on 25 Jul 2011
1 answer
290 views
Hi,

I have a user control "test.ascx" which has editable rad grid. In the aspx page, i have a rad tab-strip and radpageview. What am doing here is to add a user control dynamically (test.ascx) dynamically and adding this to multiple rad tabs. Now, any time i click on radgrid "Edit" (which is present in the user control), entire page gets lost on postback. I looked at couple of articles that was there that said to reload the controls since we are binding dynamically. But it didn't help.

Your timely help is appreciated.

Test.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Test.ascx.cs" Inherits="WebApplication4.Test" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<h4>
    Scenario Lab Management</h4>
<asp:Label ID="lblId" runat="server"></asp:Label>:
<asp:Label ID="lblValue" runat="server"></asp:Label>
<telerik:RadGrid ID="radSIFMAHypotheticalMaintenance" runat="server" AutoGenerateColumns="False"
    PageSize="25" AllowAutomaticUpdates="True">
    <MasterTableView Width="100%" PageSize="25" AutoGenerateColumns="False">
        <Columns>
            <telerik:GridButtonColumn ButtonType="LinkButton" UniqueName="EditCommandColumn"
                CommandName="Edit" Text="Edit" />
            <telerik:GridBoundColumn DataField="MaturityType" HeaderText="Maturity" SortExpression=""
                ReadOnly="true" />
            <telerik:GridBoundColumn DataField="Sequence" HeaderText="Sequence" SortExpression=""
                ReadOnly="true" />
            <telerik:GridNumericColumn UniqueName="SIFMA" SortExpression="SIFMA" HeaderText="SIFMA"
                DataType="System.Decimal" DataField="Rate" ColumnEditorID="GridNumericColumnEditor1">
            </telerik:GridNumericColumn>
        </Columns>
    </MasterTableView>
    <ClientSettings>
        <Selecting AllowRowSelect="true" />
    </ClientSettings>
</telerik:RadGrid>
<telerik:GridNumericColumnEditor ID="GridNumericColumnEditor1" runat="server">
    <NumericTextBox MaxLength="25" EmptyMessage="Percentage.">
        <NumberFormat GroupSeparator="" DecimalDigits="2" />
    </NumericTextBox>
</telerik:GridNumericColumnEditor>
<telerik:RadGrid ID="radLIBOR" runat="server" AutoGenerateColumns="False" PageSize="25">
    <MasterTableView Width="100%" CommandItemDisplay="None" PageSize="25" AutoGenerateColumns="False"
        EditMode="EditForms">
        <Columns>
            <telerik:GridButtonColumn ButtonType="LinkButton" UniqueName="EditCommandColumn"
                CommandName="Edit" Text="Edit" />
            <telerik:GridBoundColumn DataField="maturityType" HeaderText="Maturity" SortExpression=""
                ReadOnly="true" />
            <telerik:GridBoundColumn HeaderText="Sequence" DataField="sequence" SortExpression=""
                ReadOnly="true" />
            <telerik:GridNumericColumn UniqueName="LIBOR" SortExpression="LIBOR" HeaderText="LIBOR"
                DataType="System.Decimal" DataField="rate" ColumnEditorID="GridNumericColumnEditor2">
            </telerik:GridNumericColumn>
        </Columns>
    </MasterTableView>
    <ClientSettings>
        <Selecting AllowRowSelect="true" />
    </ClientSettings>
</telerik:RadGrid>
<telerik:GridNumericColumnEditor ID="GridNumericColumnEditor2" runat="server">
    <NumericTextBox MaxLength="25" EmptyMessage="Percentage.">
        <NumberFormat GroupSeparator="" DecimalDigits="2" />
    </NumericTextBox>
</telerik:GridNumericColumnEditor>

Test.ascx.cs:
using System;
 
namespace WebApplication4
{
    public partial class Test : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
 
        public void LoadData(TestData td)
        {
            lblId.Text = td.id.ToString();
            lblValue.Text = td.var1.ToString();
 
            radSIFMAHypotheticalMaintenance.DataSource = td.sifmaList;
            radLIBOR.DataSource = td.liborList;
            radSIFMAHypotheticalMaintenance.DataBind();
            radLIBOR.DataBind();
        }
    }
}
Default.aspx:

<%@ Page Title="Home Page" Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs"
    Inherits="WebApplication4._Default" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadTabStrip ID="RadTabStrip1" Width="100%" runat="server" MultiPageID="RadMultiPage1"
        SelectedIndex="0">
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
    </telerik:RadMultiPage>
    </form>
</body>
</html>

Default.aspx.cs:
using System;
using System.Collections.Generic;
using Telerik.Web.UI;
 
namespace WebApplication4
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                List<TestData> lst = DataSetUp();
 
                foreach (var item in lst)
                {
                    RadTab tab = new RadTab();
                    tab.Text = item.tabName;
                    tab.PageViewID = item.id.ToString();
                    RadTabStrip1.Tabs.Add(tab);
 
                    RadPageView pageView = new RadPageView();
                    pageView.ID = item.id.ToString();
                    Test userControl = this.LoadControl("~/Test.ascx") as Test;
                    userControl.LoadData(item as TestData);
                    pageView.Controls.Add(userControl);
                    RadMultiPage1.PageViews.Add(pageView);
                }
            }
        }
 
        private static List<TestData> DataSetUp()
        {
            List<TestData> lst = new List<TestData>();
 
 
            List<LIBOR> liborLst = new List<LIBOR>();
            liborLst.Add(new LIBOR { maturityType = "Weekly", rate = 25.5, sequence = 100 });
            liborLst.Add(new LIBOR { maturityType = "Monthly", rate = 35.5, sequence = 1001324 });
 
            List<SIFMA> sifmaLst = new List<SIFMA>();
            sifmaLst.Add(new SIFMA { maturityType = "Weekly", rate = 45.5, sequence = 1000 });
            sifmaLst.Add(new SIFMA { maturityType = "Monthly", rate = 55.5, sequence = 10013240 });
 
            var test = new TestData
            {
                id = 1,
                tabName = "10 Year Average",
                var1 = "string1",
                var2 = "string11",
                liborList = liborLst,
                sifmaList = sifmaLst
            };
 
            lst.Add(test);
 
 
            List<LIBOR> liborLst2 = new List<LIBOR>();
            liborLst2.Add(new LIBOR { maturityType = "Quarterly", rate = 65.5, sequence = 10 });
            liborLst2.Add(new LIBOR { maturityType = "Yearly", rate = 75.5, sequence = 10013 });
 
            List<SIFMA> sifmaLst2 = new List<SIFMA>();
            sifmaLst2.Add(new SIFMA { maturityType = "Quarterly", rate = 85.5, sequence = 1 });
            sifmaLst2.Add(new SIFMA { maturityType = "Yearly", rate = 95.5, sequence = 100 });
 
            var test2 = new TestData
            {
                id = 2,
                tabName = "1987 Crash",
                var1 = "string2",
                var2 = "string22",
                liborList = liborLst2,
                sifmaList = sifmaLst2
            };
            lst.Add(test2);
 
            return lst;
        }
    }
 
    public class TestData
    {
        public int id;
        public string tabName;
        public string var1;
        public string var2;
        public List<LIBOR> liborList;
        public List<SIFMA> sifmaList;
    }
 
    public class LIBOR
    {
        public string maturityType;
        public double rate;
        public int sequence;
 
        public string MaturityType
        {
            get
            {
                return maturityType;
            }
 
        }
 
        public double Rate
        {
            get
            {
                return rate;
            }
 
        }
 
        public int Sequence
        {
            get
            {
                return sequence;
            }
        }
    }
 
    public class SIFMA
    {
        public string maturityType;
        public double rate;
        public int sequence;
 
        public string MaturityType
        {
            get
            {
                return maturityType;
            }
 
        }
 
        public double Rate
        {
            get
            {
                return rate;
            }
 
        }
 
        public int Sequence
        {
            get
            {
                return sequence;
            }
        }
    }
}


Regards,
Kishan G K
Kate
Telerik team
 answered on 25 Jul 2011
1 answer
122 views
Hello-

I'm trying to remove the dotted line inserted on the active state of an item in a listbox. I've isolate the class to:

.RadListBox

 

.rlbGroup .rlbActive

 

{

 

border: 1px dotted #555;

 

 

padding: 1px 4px;

 

}


but making changes to this or any surrounding class seems to have no effect. Is there a way to get rid of this dotted line? I've search the entire solution for any other references to dotted borders and found only this.


Images attached for reference

Shinu
Top achievements
Rank 2
 answered on 25 Jul 2011
2 answers
92 views
Hi, I need to have a data grid that enables something like a detailed row view.

A bit more details:
  • Need a data grid that has one column with a checkbox in it and a couple of more columns
  • when the checkbox is clicked I need the checked row to be displayed in a detailed row view
  • the detailed row view has fewer columns and different content in the columns
  • also I need the rows to have drag and drop enabled in both detailed row view and the initial row view

And an example for my case:
  • A table that has 6 columns that represent movie info: checkbox column, id, name, year, genre, budget.
  • What I need is when the checkbox in the first column is checked the row to display: checkbox column, name, short description, budget
  • So I need year and genre columns to be replaced by short description column.
  • when the checkbos is unchecked the row should be reverted to the previous state

Is this possible to be done with the telerik RadGrid? And can you please provide short code or directions how to be achieved?
Sebastian
Telerik team
 answered on 25 Jul 2011
1 answer
269 views
Hi,

I would like to include multiple attachment columns in a RadGrid that is built dynamically.
All the attachments are comming from the same SQL table (ID, FileName, document).
Therefore my RadGrid data contains several columns generated by a stored procedure:
  • ID1, FileName1
  • ID2, Filename2
  • ID3, Filename3
  • ...

I am using SQL Server stored procedures, and specifically a proc called "getDocument" that has a single parameter: "@ID" declared as an "int" and returning "document" (the file data; varbinary). This procedure is delcared in an SqlDataSource (SqlDataSourceAttachment), with a single parameter "ID".

The problem is that in order to manage the attachment columns with several GridAttachmentColumn using that SqlDataSourceAttachment, I would have to map the @ID parameter of the SqlDataSourceAttachment with the RadGrid data columns i.e. ID1, ID2, ID3... and not just ID.

Any suggestions on how I can do that ?

François
Francois MARTIN
Top achievements
Rank 2
 answered on 25 Jul 2011
1 answer
85 views
If I move the pager, in NeedDataSource the CurrentPageIndex  is set to the current one, not to the desidered one.

To make correctly I need to manually set the CurrentPageIndex = e.NewPageIndex in the PageIndexChanged event and force a Rebind().

Is there an other way? Why I need to ask data twice to have data paged as I need (unfortunately the PageindexChanged is fired after NeedDataSource)?

Thanks

Princy
Top achievements
Rank 2
 answered on 25 Jul 2011
1 answer
106 views
I have a master/detail radgrid tied to EntityDataSOurce controls.

I can't get the where clause to work so want to use OnQueryCreated for the details table to do the proper subsetting.

I have this working with a kludge by having ItemCommand "ExpandCollapse" save the Id of the parent record that I drill into in a sesison variable and then read that session variable in the OnQueryCreated event handler for the detail table. And that works but feels bad.

How can I get the parent item Id directly from OnQueryCreated?

If I try to access like this -

    rgrdStatus.MasterTableView.DetailTables[0].ParentItem.GetDataKeyValue(

 

"Id")

the ParentItem is always null!

Thanks!

 

Shinu
Top achievements
Rank 2
 answered on 25 Jul 2011
3 answers
206 views

I am trying to bind to my labels in my nestedview template in my radgrid, but looking at telerik site but have not been able to find how they bind throught he code behind page and get a hold of the data key in the parenttablerelation.  How can I bind to my controls via code behind page.  I thought through the detialtabledatabind but nothing works for nested views.


 Protected Sub myGridDeploy_DetailTableDataBind(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles myGridDeploy.DetailTableDataBind

        If e.DetailTableView.Name = "myUnitPos" Then
            sql = "Select intPositionId, intUnitMobId, strPosnTitle, strPara, strLine, intPositionNum, strGrade, strMOS, strASI, strAuthBr, Case when intAsgnstr = 0 " _
                & "then 'NO' else 'YES' end Filled From tblMobUnitPosition where intUnitMobID = " & e.DetailTableView.ParentItem.GetDataKeyValue("intUnitMobId") & " " _
                & "order by strPara, strLine, intPositionNum"

            e.DetailTableView.DataSource = getData(sql)
        End If

        sql = "Select intDeployId,intPositionId,si.FullName,si.strRank,si.AGE,si.strPmos,si.strSMOS,si.POSN_NBR_EXCESS_IND,si.SCTY_CLNC,si.ETS,si.strstatus,si.PHYS_PRFL_SER,si.intYearSvc, si.SRpDate,si.Deployable, " _
            & "si.email From tblMobUnitPersonnel as up LEFT JOIN vw_Soldierinfo as si on si.strssn = up.strSSN where up.intPositionId = " & e.DetailTableView.ParentItem.GetDataKeyValue("intPositionId") & ""

    End Sub


<telerik:GridTableView DataKeyNames="intPositionId" Name="myUnitPos" Width="100%" TableLayout="Fixed" BorderWidth="1px" CellPadding="6" Font-Size="10"
                                    AutoGenerateColumns="False" HeaderStyle-HorizontalAlign="Center" BorderColor="#404040" Font-Names="Veranda,arial,sans-serif" GridLines="Both" ExpandCollapseColumn-ButtonType="ImageButton"
                                    ExpandCollapseColumn-CollapseImageUrl="~/Images/30.png" ExpandCollapseColumn-ExpandImageUrl="~/Images/29.png">
                                    <ParentTableRelation>
                                        <telerik:GridRelationFields DetailKeyField="intUnitMobId" MasterKeyField="intUnitMobId" />
                                    </ParentTableRelation>
                                    <HeaderStyle Font-Bold="true" HorizontalAlign="Center" CssClass="InnerSubHeaderStyle" />
                                    <ItemStyle CssClass="InnerSubItemStyle" HorizontalAlign="Center"  />
                                    <AlternatingItemStyle CssClass="InnerSubAlernatingItemStyle" HorizontalAlign="Center" />
                                        <NestedViewSettings>
                                            <ParentTableRelation>
                                                 <telerik:GridRelationFields DetailKeyField="intPositionId" MasterKeyField="intPositionId" />
                                            </ParentTableRelation>
                                        </NestedViewSettings>
                                        <NestedViewTemplate>
                                            <asp:Panel ID="pnlInfo" runat="server" BorderStyle="Double" BorderColor="#85A3E0" Width="50%">
                                                <table >
                                                    <tr>
                                                        <td><u>Soldier Information</u></td>
                                                    </tr>
                                                    <tr>
                                                        <td style="height:5px"></td>
                                                    </tr>
                                                     <tr>
                                                        <td>
                                                            Name:&nbsp;<asp:Label ID="lblSoldier" runat="server" Text='<%#Bind("FUllName") %>'></asp:Label>&nbsp;&nbsp;
                                                            Rank:&nbsp;<asp:label ID="lblRank" runat="server" Text='<%#Bind("strRank") %>'></asp:label>&nbsp;&nbsp;
                                                            Age:&nbsp;<asp:Label ID="lblAge" runat="server" Text='<%#Bind("AGE") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td style="height:5px"></td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            PMOS:&nbsp;<asp:Label ID="lblPMOS" runat="server"></asp:Label>&nbsp;&nbsp;
                                                            SMOS:&nbsp;<asp:label ID="lblSMOS" runat="server"></asp:label>&nbsp;&nbsp;
                                                            POSN Excess:&nbsp;<asp:Label ID="lblPOSN" runat="server"></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td style="height:5px"></td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            Clearance:&nbsp;<asp:Label ID="lblClear" runat="server"></asp:Label>&nbsp;&nbsp;
                                                            ETS\MRD:&nbsp;<asp:label ID="lblEts" runat="server"></asp:label>&nbsp;&nbsp;
                                                            Full-Time:&nbsp;<asp:Label ID="lblFullTime" runat="server"></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td style="height:5px"></td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            PULHES:&nbsp;<asp:Label ID="lblPuhles" runat="server"></asp:Label>&nbsp;&nbsp;
                                                            Yrs Active:&nbsp;<asp:label ID="lblYrsActive" runat="server"></asp:label>
                                                        </td>
                                                    </tr>
                                                     <tr>
                                                        <td style="height:5px"></td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            SRP Date:&nbsp;<asp:Label ID="lblDtSrp" runat="server"></asp:Label>&nbsp;&nbsp;
                                                            Deployable:&nbsp;<asp:label ID="lblDeplyable" runat="server"></asp:label>
                                                        </td>
                                                    </tr>
                                                     <tr>
                                                        <td style="height:5px"></td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            Email:&nbsp;<asp:Label ID="lblEmail" runat="server"></asp:Label>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </asp:Panel>
                                        </NestedViewTemplate>
                                        <Columns>




Genti
Telerik team
 answered on 25 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?