Telerik Forums
UI for ASP.NET AJAX Forum
15 answers
345 views
Dear All,

when save the docks on page after user cusomize position and every thing on cookies using this code,,,


protected

void RadDockLayout1_LoadDockLayout(object sender, Telerik.Web.UI.DockLayoutEventArgs e)

 

{

HttpCookie dockState = Page.Request.Cookies.Get(

"MyApplicationDockStates85216");

 

 

if (dockState != null)

 

{

 

string serializedList = dockState.Value;

 

 

if (serializedList != null)

 

{

 

string[] states = serializedList.Split('|');

 

 

for (int i = 0; i < states.Length; i++)

 

{

DockState state = DockState.Deserialize(states[i]);

e.Positions[state.UniqueName] = state.DockZoneID;

e.Indices[state.UniqueName] = state.Index;

}

}

}
}

and 

 

protected

void RadDockLayout1_SaveDockLayout(object sender, Telerik.Web.UI.DockLayoutEventArgs e)

 

{

HttpCookie dockState = Page.Response.Cookies.Get(

"MyApplicationDockStates85216");

 

 

if (dockState == null)

 

{

dockState =

new HttpCookie("MyApplicationDockStates85216");

 

Page.Response.Cookies.Add(dockState);

}

 

List<DockState> stateList = ((RadDockLayout)sender).GetRegisteredDocksState();

 

 

StringBuilder serializedList = new StringBuilder();

 

 

for (int i = 0; i < stateList.Count; i++)

 

{

serializedList.Append(stateList[i].ToString());

serializedList.Append(

"|");

 

}

dockState.Expires =

DateTime.Today.AddMonths(1);

 

dockState.Value = serializedList.ToString();

 

}

all position saved and every thing well but closed Docks or minimze Docks not saved
i.e when close dock or minmize dock,,,,after postback the closed/minimzed docks still as first time

anyone have solution for this problem?

thanks in advanced

Maas Prog
Top achievements
Rank 1
 answered on 04 Mar 2010
1 answer
119 views
I have added an OnItemCommand to my FileExplorer control, and it is firing once per file uploaded. If I attempt to upload three files at once, the command fires three times?? I would expect it to fire only once.
Atlas
Top achievements
Rank 1
 answered on 04 Mar 2010
8 answers
713 views
Hello

I trying to put a filter expression on my item command, I set my filterExpression like http://www.telerik.com/help/aspnet-ajax/telerik.web.ui-telerik.web.ui.gridtableview-filterexpression.html.


I have this code:
Dim column As GridColumn = rgWorkflow.MasterTableView.GetColumnSafe("Denominacion")  
            column.CurrentFilterFunction = GridKnownFunction.Contains  
            column.CurrentFilterValue = TryCast(TryCast(rgWorkflow.MasterTableView.GetItems(GridItemType.FilteringItem)(0),  _  
                    GridFilteringItem)("Denominacion").Controls(0), TextBox).Text  
            If Not column.CurrentFilterValue = String.Empty Then 
                rgWorkflow.MasterTableView.FilterExpression = "([Denominacion] LIKE '%" & column.CurrentFilterValue & "%') " 
                'rgWorkflow.MasterTableView.FilterExpression = "[Denominacion like '%" & column.CurrentFilterValue & "%']"  
            End If 

I execute this code when the user do click in a imagebutton that I put in my FilteringItem, later in final of the ItemCommand I fill a datasource to the RadGrid and do databind.

When I do databind to the control, the application throws a PageRequestManagerServerErrorException: Expression expected.

Thanks.
Sebastian
Telerik team
 answered on 04 Mar 2010
3 answers
205 views
I'm having a hell of a time trying to get this styling to behave.  Maybe I'm pushing the styling limits or possibly putting way too many rad controls together and it's throwing off the style.  However, any help removing the redundant scroll bars is greatly appreciated.

I have a sandbox project if you'd like me to include it.
Victor Campos
Top achievements
Rank 2
 answered on 04 Mar 2010
3 answers
112 views
I am a new user.  I am attempting to get a simple grid to display and then sort data.  I have hard coded values into a datatable to simulate DB access.  The grid displays the data on page load without issue.  However, when click on any column heading an exception is encountered.  - Specified cast is not valid. 

        <telerik:RadGrid ID="ContractGrid" runat="server"  EnableViewState="False"   
            Skin="Outlook" AllowSorting="True"   
                    GridLines="None" AutoGenerateColumns="False" AllowPaging="true" 
                     Width="1000px" > 
            <PagerStyle Mode="NextPrevAndNumeric" />   
            <ClientSettings>     
                <Selecting AllowRowSelect="True" /> 
                <ClientEvents OnCommand="CommandDispatcher"   
                    OnRowClick="ContractRowEdit" 
                     OnRowMouseOver="ContractRowMouseOver" 
 
                    /> 
            </ClientSettings> 
            <SelectedItemStyle BackColor="Beige" /> 
            <MasterTableView   
                 DataKeyNames="ContractID"   
                 ClientDataKeyNames="ContractID,ContractNumber,Acronym,ProgramName,Division,  
                                    MfgLocation,CustomerName,SubcontractIndicator,AddDate,ArchiveIndicator,ArchiveDate"   
                 AllowAutomaticInserts="false" 
                 AllowAutomaticUpdates="false"   
                 GroupLoadMode="Client" 
                 PageSize = "15" 
                 ShowHeadersWhenNoRecords="true">  
                <Columns> 
                      
                    <telerik:GridTemplateColumn SortExpression="ContractID" 
                            UniqueName="ContractID" Display="false">  
                        <ItemTemplate > 
                            <asp:Label ID="lblContractID"   
                                    Text='<%# Eval("ContractID") %>' 
                                    runat="server"  /> 
                        </ItemTemplate> 
                          
                    </telerik:GridTemplateColumn>   
                          
                    <telerik:GridTemplateColumn SortExpression="ContractNumber" HeaderStyle-HorizontalAlign="Center" 
                            UniqueName="ContractNumber"  HeaderText="Contract Number" Display="true" > 
                        <ItemTemplate > 
                            <asp:Label ID="lblContractNumber"   
                                    Text='<%# Eval("ContractNumber") %>' 
                                    runat="server"  /> 
                        </ItemTemplate> 
                        <ItemStyle Width="80px" /> 
                    </telerik:GridTemplateColumn>   
 
                    <telerik:GridTemplateColumn SortExpression="Acronym" HeaderStyle-HorizontalAlign="Center" 
                            UniqueName="Acronym" HeaderText="Acronym" Display="true" > 
                        <ItemTemplate > 
                            <asp:Label ID="lblAcronym"   
                                    Text='<%# Eval("Acronym") %>' 
                                    runat="server"  /> 
                        </ItemTemplate> 
                        <ItemStyle Width="60px" /> 
                    </telerik:GridTemplateColumn>   
                                             
                     <telerik:GridTemplateColumn SortExpression="ProgramName" HeaderStyle-HorizontalAlign="Center" 
                            UniqueName="ProgramName" HeaderText="Program Name" Display="true" > 
                        <ItemTemplate > 
                            <asp:Label ID="lblProgramName"   
                                    Text='<%# Eval("ProgramName") %>' 
                                    runat="server"  /> 
                        </ItemTemplate> 
                        <ItemStyle Width="120px" /> 
                    </telerik:GridTemplateColumn>   
                                             
                     <telerik:GridTemplateColumn SortExpression="Division" HeaderStyle-HorizontalAlign="Center" 
                            UniqueName="Division" HeaderText="Division" Display="true" > 
                        <ItemTemplate > 
                            <asp:Label ID="lblDivision"   
                                    Text='<%# Eval("Division") %>' 
                                    runat="server"  /> 
                        </ItemTemplate> 
                        <ItemStyle Width="60px" /> 
                    </telerik:GridTemplateColumn>   
                                             
                     <telerik:GridTemplateColumn SortExpression="MfgLocation" HeaderStyle-HorizontalAlign="Center" 
                            UniqueName="MfgLocation" HeaderText="Location" Display="true" > 
                        <ItemTemplate > 
                            <asp:Label ID="lblMfgLocation"   
                                    Text='<%# Eval("MfgLocation") %>' 
                                    runat="server"  /> 
                        </ItemTemplate> 
                        <ItemStyle Width="60px" /> 
                    </telerik:GridTemplateColumn>   
                                             
                     <telerik:GridTemplateColumn SortExpression="CustomerName" HeaderStyle-HorizontalAlign="Center" 
                            UniqueName="CustomerName" HeaderText="Customer" Display="true" > 
                        <ItemTemplate > 
                            <asp:Label ID="lblCustomerName"   
                                    Text='<%# Eval("CustomerName") %>' 
                                    runat="server"  /> 
                        </ItemTemplate> 
                        <ItemStyle Width="60px" /> 
                    </telerik:GridTemplateColumn>   
 
                    <telerik:GridTemplateColumn SortExpression="SubcontractIndicator" 
                            UniqueName="SubcontractIndicator"   
                            HeaderText="Sub<br />Contract" 
                            HeaderStyle-HorizontalAlign="Center"  ItemStyle-Width="20px"   
                            ItemStyle-HorizontalAlign="Center"   
                            ItemStyle-Font-Bold="true" > 
                        <ItemTemplate > 
                            <asp:CheckBox ID="SubcontractIndicator"   
                                Checked='<%# Eval("SubcontractIndicator") %>' 
                                Font-Bold="true" 
                                Enabled="false"     
                                ToolTip="Is C4S is a subcontractor?"                                  
                                runat="server"  /> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn>                      
 
                    <telerik:GridTemplateColumn SortExpression="AddDate" HeaderStyle-HorizontalAlign="Center" 
                            UniqueName="AddDate" HeaderText="Date Added" Display="true" > 
                        <ItemTemplate > 
                            <asp:Label ID="lblAddDate"   
                                    Text='<%# Eval("AddDate") %>' 
                                    runat="server"  /> 
                        </ItemTemplate> 
                        <ItemStyle Width="60px" /> 
                    </telerik:GridTemplateColumn>   
 
                    <telerik:GridTemplateColumn SortExpression="ArchiveIndicator" 
                        UniqueName="ArchiveIndicator"   
                        HeaderText="Archived" 
                        HeaderStyle-HorizontalAlign="Center"  ItemStyle-Width="20px"   
                        ItemStyle-HorizontalAlign="Center"   
                        ItemStyle-Font-Bold="true" > 
                        <ItemTemplate > 
                            <asp:CheckBox ID="ArchiveIndicator"   
                                Checked='<%# Eval("ArchiveIndicator") %>' 
                                Font-Bold="true" 
                                Enabled="false"     
                                ToolTip="Has the customer archived this contract?"                                  
                                runat="server"  /> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn>                      
 
                    <telerik:GridTemplateColumn SortExpression="ArchiveDate" HeaderStyle-HorizontalAlign="Center" 
                            UniqueName="ArchiveDate" HeaderText="Date Archived" Display="true" > 
                        <ItemTemplate > 
                            <asp:Label ID="lblArchiveDate"   
                                    Text='<%# Eval("ArchiveDate") %>' 
                                    runat="server"  /> 
                        </ItemTemplate> 
                        <ItemStyle Width="60px" /> 
                    </telerik:GridTemplateColumn>   
 
                    <telerik:GridTemplateColumn SortExpression="UpdatedDate" HeaderStyle-HorizontalAlign="Center" 
                            UniqueName="UpdatedDate" HeaderText="Date Updated" Display="true" > 
                        <ItemTemplate > 
                            <asp:Label ID="lblUpdatedDate"   
                                    Text='<%# Eval("UpdatedDate") %>' 
                                    runat="server"  /> 
                        </ItemTemplate> 
                        <ItemStyle Width="60px" /> 
                    </telerik:GridTemplateColumn>   
 
                    <telerik:GridTemplateColumn SortExpression="UpdatedName" HeaderStyle-HorizontalAlign="Center" 
                            UniqueName="UpdatedName" HeaderText="Updated By" Display="true" > 
                        <ItemTemplate > 
                            <asp:Label ID="lblUpdatedName"   
                                    Text='<%# Eval("UpdatedName") %>' 
                                    runat="server"  /> 
                        </ItemTemplate> 
                        <ItemStyle Width="100px" /> 
                    </telerik:GridTemplateColumn>   
 
 
                </Columns> 
        
            </MasterTableView> 
                       
                       
                       
                       
        </telerik:RadGrid> 
 
Code behind follows
    protected void Page_Load(object sender, EventArgs e)  
    {  
        if (!IsPostBack)  
        {  
            LoadGridData();  
        }  
 
    }  
    protected void LoadGridData()  
    {  
        DataTable dt = new DataTable();  
        dt.Columns.Add("ContractID"typeof(int));  
        dt.Columns.Add("ContractNumber"typeof(string));  
        dt.Columns.Add("Acronym"typeof(string));  
        dt.Columns.Add("ProgramName"typeof(string));  
        dt.Columns.Add("Division"typeof(string));  
        dt.Columns.Add("MfgLocation"typeof(string));  
        dt.Columns.Add("CustomerName"typeof(string));  
        dt.Columns.Add("SubcontractIndicator"typeof(bool));  
        dt.Columns.Add("ArchiveIndicator"typeof(bool));  
        dt.Columns.Add("AddDate"typeof(string));  
        dt.Columns.Add("ArchiveDate"typeof(string));  
        dt.Columns.Add("UpdatedDate"typeof(string));  
        dt.Columns.Add("UpdatedName"typeof(string));  
        DataRow dr = dt.NewRow();  
        dr["ContractID"] = 1;  
        dr["ContractNumber"] = "ABC123DA0011";  
        dr["Acronym"] = "ABC";  
        dr["ProgramName"] = "Description one";  
        dr["Division"] = "DSN";  
        dr["MfgLocation"] = "CALIFORNIA";  
        dr["CustomerName"] = "DISNEY";  
        dr["SubcontractIndicator"] = true;  
        dr["ArchiveIndicator"] = false;  
        dr["AddDate"] = "23-May-2001";  
        dr["ArchiveDate"] = DBNull.Value;  
        dr["UpdatedDate"] = "01-Nov-2009";  
        dr["UpdatedName"] = "Super-User, Jane";  
        dt.Rows.Add(dr);  
        DataRow dr2 = dt.NewRow();  
        dr2["ContractID"] = 2;  
        dr2["ContractNumber"] = "XYZ123DA0011";  
        dr2["Acronym"] = "XYZ";  
        dr2["ProgramName"] = "Description two";  
        dr2["Division"] = "CND";  
        dr2["MfgLocation"] = "NEW YORK";  
        dr2["CustomerName"] = "CITY OF NY";  
        dr2["SubcontractIndicator"] = false;  
        dr2["ArchiveIndicator"] = true;  
        dr2["AddDate"] = "23-Oct-2002";  
        dr2["ArchiveDate"] = "01-Nov-2005";  
        dr2["UpdatedDate"] = "20-Nov-2005";  
        dr2["UpdatedName"] = "Super-User, Jane";  
        dt.Rows.Add(dr2);  
 
 
        ContractGrid.DataSource = dt;  
 
    }  
    protected void ContractGrid_PageIndexChanged(object source, Telerik.Web.UI.GridPageChangedEventArgs e)  
    {  
        LoadGridData();  
    }  
 
    protected void ContractGrid_SortCommand(object source, Telerik.Web.UI.GridSortCommandEventArgs e)  
    {  
        LoadGridData();  
    }  
 
Martin
Telerik team
 answered on 04 Mar 2010
9 answers
228 views
Okay this bug has me baffled.  I have a rad combobox on a web page.  I am getting a "Selection out of range" error in my logs.  I have added mycombobox.ClearSelection before databinding which was recommended in another post. However, the problem still exists.  Also, I can't reproduce the problem.  When I go to my site, it works fine.  However, there is something that the user is doing to get this to happen.  Any help would be greatly appreciated.  Below is my code:

            Dim blankStreet As New StreetTypeListItem
            Dim streetTypes As New StreetTypeList

            With blankStreet
                .AddressType = "N/A"
                .TypeDescription = "N/A"
            End With

            'Retrieve the list of available street types from our database.
            streetTypes = GetStreetTypes()

            If (streetTypes IsNot Nothing) Then

                Dim stTypes As New List(Of StreetTypeListItem)

                For Each streetType As StreetTypeListItem In _
                    streetTypes.StreetTypes
                    stTypes.Add(streetType)
                Next

                ddlStreetType.DataTextField = "TypeDescription"
                ddlStreetType.DataValueField = "AddressType"
                stTypes.Insert(0, blankStreet)

               ddlStreetType.ClearSelection()
               ddlStreetType.DataSource = stTypes
               ddlStreetType.DataBind()

          End If

Simon
Telerik team
 answered on 04 Mar 2010
4 answers
223 views

“I am not able to give line break to the node text. It is display in single line

But I need to display node text as two lines. Can you please tell me the solution to solve this issue “

sathish venkat
Top achievements
Rank 2
 answered on 04 Mar 2010
1 answer
143 views
Hi Team,

In RadTabStrip, I want a radGrid to be populated dynamically, ie., based on my tabclick the Grid needs to be populated with data.
If I click Tab1, the grid should populate with names starting with 'A', for Tab2_click, grid with names starting with 'B', for Tab3_click, grid with names starting with 'C' and so on...But I can't place multiple grids.I sit possible using RadTabstrip?

Please reply me with sample code....



-Liji Gilesh
Yana
Telerik team
 answered on 04 Mar 2010
19 answers
677 views

For some reason, Intellisense does not work when using Visual Studio 2008. I've been using your controls for some time now and I'm not doing anything different causing Intellisense not to work. It's been tested on different PC's with Visual Studio 2008 installed and none of them work.

It doesn't matter which way I register the Telerik DLL, Intellisense doesn't show up. For example:

<%

@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

or 

<

add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"></add>


Please advise! This is a huge roadblock for me. Thank you in advance.

sunil
Top achievements
Rank 1
 answered on 04 Mar 2010
1 answer
401 views
I am using a RadComboBox with EnableLoadOnDemand="true", and OnItemsRequested="brand_ItemsRequested" - I want to add a default item that appears at the top of the list, so I have added comboBrand.Items.Insert(0, new RadComboBoxItem("All Brands", "0")); 

protected void brand_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e) 
        { 
            DataTable data = GetData(e.Text); 
 
            int itemOffset = e.NumberOfItems; 
            int endOffset = Math.Min(itemOffset + ItemsPerRequest, data.Rows.Count); 
            e.EndOfItems = endOffset == data.Rows.Count; 
 
            for (int i = itemOffset; i < endOffset; i++) 
            { 
                comboBrand.Items.Add(new RadComboBoxItem(data.Rows[i]["Name"].ToString(), data.Rows[i]["Name"].ToString())); 
            } 
 
            comboBrand.Items.Insert(0, new RadComboBoxItem("All Brands""0"));  
            e.Message = GetStatusMessage(endOffset, data.Rows.Count); 
        } 

<telerik:RadComboBox ID="comboBrand" AppendDataBoundItems="true"  LoadingMessage="Retrieving Brands..." AutoPostBack="true" runat="server" Width="250px" Height="150px" 
            EnableLoadOnDemand="true" ShowMoreResultsBox="true" ShowWhileLoading="false"  
            EnableVirtualScrolling="true" OnSelectedIndexChanged="comboBrand_SelectedIndexChanged" 
            OnItemsRequested="brand_ItemsRequested">  
        </telerik:RadComboBox> 


The trouble is, each time more results load and appends to the list, "All Brands" is also appended to the results that are returned, so it appears every 12th row. How can I insert just a single default value at the top of the list?

EDIT:

I tried wrapping some logic around the the  comboBrand.items.insert to check for the item before inserting the default item, but multiple items are still being added:

if (!comboBrand.Items.Contains(new RadComboBoxItem("All Brands""All Brands"))) 
            { 
                comboBrand.Items.Insert(0, new RadComboBoxItem("All Brands""All Brands")); 
            } 

Simon
Telerik team
 answered on 04 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?