Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
314 views
Can I bind a GridDropDownColumn to a List<string>?
tim
Top achievements
Rank 1
 answered on 04 Mar 2010
8 answers
385 views
Hi,

I have an aspx page that contains 4 user controls. The apsx page contains a RadAjaxManager control and each user control (.ascx) has a RadAjaxManagerProxy. Currently, I ajaxify all 4 user controls simultaneously through ajaxRequest call in the aspx page as follows:

Base.aspx :

<script type="text/javascript"> 
         function pageLoad(sender, eventArgs) { 
             if (!eventArgs.get_isPartialLoad()) { 
                 $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest('WidgetLoad'); 
             } 
         }       
</script>   


The argument 'WidgetLoad' gets parsed inside the ajaxRequest handler that's defined in each user control (ascx.cs). This works perfectly however some user controls take longer to update than others and thus block the updating process for the other more quicker user controls. Therefore, I would like to have each user control update independently, as soon as its ready. To do this, I tried calling 4 separate ajaxRequest methods instead of one, passing a unique ID for the user control as an argument each time. However, this does not seem to work. It seems as though it only accepts the last ajaxRequest call thus causing only one user control to update. Can you explain why we cannot call multiple ajaxRequest with same RadAjaxManager? How else can I achieve this behavior?

Jim
Jimmy Nicolacopoulos
Top achievements
Rank 1
 answered on 04 Mar 2010
2 answers
357 views
Hi All,

I am using RadControls for ASPNET AJAX Q2 2008.

I am using Radgrid.
I have given the fix width to each column in grid.
When data is greater than the column width the it wrap the text to next line.
I want to show the grid row data in one line.
ie. It should show only that data which is fit in one row of secified column width.
It should not wrap the text automatically.

Thanks.




Jason Divis
Top achievements
Rank 1
 answered on 04 Mar 2010
3 answers
211 views
hi

my footer text doesnt show on my aggregate column

here is the code:
                    <telerik:RadGrid ID="grdOrdini" DataSourceID="objDSOrd" runat="server" Width="99.7%" 
                        AutoGenerateColumns="False" PageSize="15" AllowSorting="True" AllowPaging="True" ShowHeader="true" 
                        GridLines="None" ShowStatusBar="true" AllowAutomaticUpdates="true" ShowFooter="True" > 
                        <PagerStyle Mode="NumericPages" AlwaysVisible="true"></PagerStyle> 
                        <FooterStyle Font-Bold="true" /> 
                        <MasterTableView DataSourceID="objDSOrd" DataKeyNames="CODICE" AllowMultiColumnSorting="True" 
                            Width="100%" EditMode="InPlace"> 
                            <Columns> 
                                <telerik:GridButtonColumn ConfirmText="Rimouvere dal Elenco degli ordini?" ButtonType="ImageButton" ImageUrl="~/img/DelCart.png" CommandName="Delete" Text="Rimouvi dal elenco" UniqueName="colDelete"> 
                                    <HeaderStyle Width="35px" /> 
                                </telerik:GridButtonColumn>                                
                                <telerik:GridEditCommandColumn EditImageUrl="~/img/Edit.gif" UniqueName="btnEdit" CancelText="Cancel" UpdateText="Save" EditText="Modifica"></telerik:GridEditCommandColumn>                           
                                <telerik:GridBoundColumn SortExpression="LISTINO" HeaderText="Listino" DataField="LISTINO" UniqueName="colLISTINO1" ReadOnly="true"> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn SortExpression="LISTINO" HeaderText="Listino" DataField="LISTINO" UniqueName="colLISTINO" Visible="false"> 
                                </telerik:GridBoundColumn>                                                 
                                <telerik:GridBoundColumn SortExpression="DTORDINE" HeaderText="Data Ordine" DataField="DTORDINE" UniqueName="colDTORDINE" DataType="System.DateTime" DataFormatString="{0: dd/MM/yyyy}" ReadOnly="true"> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn SortExpression="DTSCADENZA" HeaderText="Data Scadenza" DataField="DTSCADENZA" UniqueName="colDTSCADENZA" DataType="System.DateTime" DataFormatString="{0: dd/MM/yyyy}" ReadOnly="true"> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridNumericColumn SortExpression="QUANTITA" HeaderText="Q.tà" DataField="QUANTITA" UniqueName="colQUANTITA"> 
                                </telerik:GridNumericColumn> 
                                <telerik:GridNumericColumn SortExpression="COSTOUNITARIO" HeaderText="Costo Unitario" DataField="COSTOUNITARIO" UniqueName="colCOSTOUNITARIO" DataType="System.Double" DataFormatString="{0:€ # ###.##}" ReadOnly="true"> 
                                </telerik:GridNumericColumn> 
                                <telerik:GridNumericColumn SortExpression="COSTOUNITARIO" HeaderText="Costo Unitario" DataField="COSTOUNITARIO" UniqueName="colCOSTOUNITARIO2" DataType="System.Double" Visible="false"> 
                                </telerik:GridNumericColumn>                                 
                                <telerik:GridNumericColumn SortExpression="SCONTO" HeaderText="Sconto %" DataField="SCONTO" UniqueName="colSCONTO" ReadOnly="true" DataType="System.Double" NumericType="Percent"> 
                                </telerik:GridNumericColumn> 
                                <telerik:GridBoundColumn  SortExpression="COSTONETTO" HeaderText="Costo Netto" DataField="COSTONETTO" UniqueName="colCOSTONETTO" DataType="System.Double" DataFormatString="{0:€ # ###.##}" ReadOnly="true" Aggregate="Sum" FooterText="Totale Netto: "> 
                                </telerik:GridBoundColumn >                                         
                            </Columns> 
                        </MasterTableView> 
                    </telerik:RadGrid> 

Daniel
Telerik team
 answered on 04 Mar 2010
15 answers
352 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
127 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
729 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
219 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
120 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
237 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?