Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
197 views
Since the filter values selected by the user are cleared out upon changing the filter when using a <FilterTemplate> with the NeedsDataSource event I need a way to repopulate the filter controls after the user has selected a filter from the combobox. I can find no examples that demonstrate how to actually repopulate the controls in the <FilterTemplate> with the values selected by the user so can someone please help me out? It would be very frustrating to the users and unprofessional to have what they selected reset every time they change any of the filters.

Thanks!
Sebastian
Telerik team
 answered on 09 Mar 2009
8 answers
411 views

I have a RadGrid inside a WebUserControl that allows filtering. The textboxes and filter images show up just fine but nothing happens when clicking on the little filter image, there are no options for any of them. Here is my grid:

<telerik:RadGrid ID="RadGridEmployeeTransactions" runat="server"   
    AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True"   
    AutoGenerateColumns="False" GridLines="None" ShowGroupPanel="True" Width="430px">  
    <HeaderContextMenu> 
        <CollapseAnimation Duration="200" Type="OutQuint" /> 
    </HeaderContextMenu> 
    <MasterTableView> 
        <Columns> 
            <telerik:GridBoundColumn DataField="TransactionID" Groupable="False"   
                HeaderText="ID" ReadOnly="True" SortExpression="TransactionID"   
                UniqueName="TransactionID" FilterListOptions="VaryByDataType"   
                DataType="System.Int64" FilterControlWidth="50px">  
                <HeaderStyle HorizontalAlign="Center" Width="70px" /> 
                <ItemStyle HorizontalAlign="Center" Width="70px" />                                          
            </telerik:gridboundcolumn> 
            <telerik:GridBoundColumn DataField="DateSubmitted" Groupable="True"   
                HeaderText="Date Submitted" ReadOnly="True" SortExpression="DateSubmitted"   
                UniqueName="DateSubmitted" GroupByExpression="DateSubmitted"   
                DataFormatString="{0:d}" FilterListOptions="VaryByDataType">  
                <HeaderStyle HorizontalAlign="Center" Width="90px" /> 
                <ItemStyle HorizontalAlign="Center" Width="90px" /> 
            </telerik:gridboundcolumn> 
            <telerik:GridBoundColumn DataField="Tooltip" Groupable="True"   
                HeaderText="Transaction Type" ReadOnly="True" SortExpression="Tooltip"   
                UniqueName="Tooltip" GroupByExpression="Tooltip"   
                FilterListOptions="VaryByDataType" FilterControlWidth="200px">  
                <HeaderStyle HorizontalAlign="Left" Width="250px" /> 
                <ItemStyle HorizontalAlign="Left" Width="250px" /> 
            </telerik:gridboundcolumn> 
        </Columns> 
    </MasterTableView> 
    <ClientSettings AllowDragToGroup="True">  
    </ClientSettings> 
    <FilterMenu> 
        <CollapseAnimation Duration="200" Type="OutQuint" /> 
    </FilterMenu> 
</telerik:RadGrid> 
Sebastian
Telerik team
 answered on 09 Mar 2009
1 answer
186 views
I'm enhancing our ticket tracking system to allow users to organize the priority of their tickets similar to a Netflix queue.  I'm using the RadGrid to display all the tickets with an "Precedent Number" column that is a HtmlHelper.TextBox inside of an ItemTemplate column.

The view code looks like this:
<% using (Html.BeginForm()) {%> 
    <div style="width: 100%;"
        <div style="float: left;"
            <input type="submit" value="Save Queue Changes" /></div
        <div style="float: right; text-align: right;"
            <%= String.Format("{0} Tickets in Queue", Model.Rows.Count) %></div
    </div> 
     
    <telerik:RadGrid ID="rgTickets" runat="server" AutoGenerateColumns="false" Style="clear: both;"
        <MasterTableView DataKeyNames="CallId" EditMode="InPlace"
            <Columns> 
                <telerik:GridTemplateColumn> 
                    <HeaderStyle Width="50px" /> 
                    <ItemStyle Width="50px" /> 
                    <ItemTemplate> 
                        <%# Html.TextBox("Precedence", Eval("Precedence"), new { width = "25px" })%> 
                        <%# Html.ActionLink("Move To Top", "MoveToTop", new { ticketId = ((System.Data.DataRowView)Container.DataItem)["CallId"], queueId = ((QueueDefEntity)ViewData["QueueDef"]).QueueId })%> 
                        <br /> 
                        <%# Eval("InsertDate").ToString().Length > 0 ? string.Format("Prioritized by {0} <br />{1}",Eval("InsertUser"),Eval("InsertDate")) : "" %> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridBoundColumn DataField="CallId" UniqueName="CallId" HeaderText="Ticket Number" /> 
                <telerik:GridBoundColumn DataField="CallDesc" UniqueName="CallDesc" HeaderText="Problem Description" /> 
                <telerik:GridBoundColumn DataField="ReceivedTimestamp" UniqueName="ReceivedTimestamp" 
                    HeaderText="Received" DataFormatString="{0:dd MMM yyyy h:mm tt}" /> 
            </Columns> 
        </MasterTableView> 
    </telerik:RadGrid> 
    <% } %> 

When the user clicks the "Save Queue Changes" submit button, how do I get at the values inside of each text box?  My view is typed as such:

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<System.Data.DataTable>" %> 

...what should I be expecting in my controller action method as a return value to enumerate through all the rows in the grid?
Rosen
Telerik team
 answered on 09 Mar 2009
20 answers
878 views
I am having difficulty with the filter of the RadGrid.  I know that I need to use the NeedDataSource event in order for filtering to work, so I did do that.  After doing that, the grid performs fine with sorting and paging, but the grid does not filter properly.  I am able to filter on the first column which is numeric, but the remaining column filters (all string values) will not work.  I tried to enter a value in and then select "Contains" as the filter and I get every row returned (none filtered).  In fact, if the view was already filtered due to the functioning filtering of the numeric column, then trying to filter on any other column will cause all records to show, meaning even the numeric filter column stops working.

My code is below.


 
                <telerik:RadGrid ID="rgProducts" runat="server" AllowFilteringByColumn="True"   
                    AllowPaging="True" AllowSorting="True" AutoGenerateDeleteColumn="True"   
                    AutoGenerateEditColumn="True" GridLines="None" Skin="Vista"   
                    ClientSettings-Selecting-AllowRowSelect="true"   
                    OnNeedDataSource="rgProducts_NeedDataSource" AutoPostBackOnFilter="true"><mastertableview><rowindicatorcolumn   
                        visible="False"><HeaderStyle Width="20px" /></rowindicatorcolumn><expandcollapsecolumn resizable="False" visible="False"><HeaderStyle Width="20px" /></expandcollapsecolumn><editformsettings><popupsettings scrollbars="None" /></editformsettings></mastertableview><clientsettings><selecting   
                        allowrowselect="True" /> 
                </clientsettings> 
                </telerik:RadGrid> 

        protected void rgProducts_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
        {  
            MyDataContext db = new MyDataContext();  
 
            rgProducts.DataSource =  
                from products in db.Product_GetByProductTypeId(1)  
                select products;   
        } 

In case it matters, this is code contained within a module for DotNetNuke.

Thanks!

Michael

Sebastian
Telerik team
 answered on 09 Mar 2009
2 answers
80 views

I have a grid which loads 10 columns * 30 rows by default.

Based on a tabstrip selection, I want to rebind the grid with data fetched using JSON serialization. Everything is OK until the OnSuccess method where the correct result is returned.

Do note that the result can bring in variable number of columns (either a subset of default or totally new columns) -- say for my first tab click, 6 totally new columns are returned along with 30 rows.

In this case the following does *NOT* work -- basically it does not reset the state of the grid & its underlying master table view on the client side. And I'm unable to manually set the .innerHTML of the cells since iterating through the columns of the master view accessed by get_masterTableView() contains the column collection loaded by default.

 

 

function updateGrid(result, userContext, methodName)

 

{

 

    tableView.set_dataSource(result);

    tableView.dataBind();

}

Please suggest a workaround as to how I can reset the state to 6 cols * 30 rows ?

Thanks a lot 
- Arun 

Nikolay Rusev
Telerik team
 answered on 09 Mar 2009
1 answer
194 views
I am using a RadTextBox in a RadGrid Footer for insert.  I added an Insert button as well.  My Server side code in the grid_ItemCommand event grabs the footer item by e.Item.  I then search for my RadTextBox via footer.FindControl("txtName").
That function call returns me an object with the correct ID.  The ClientID matches the HTML as well.  However the Text that was entered does not get populated in the txtName.Text property.

I can get the text from request.form(txtName.ClientID & "_text").  It's a work-around but it's not the best solution.

Thanks,
Doug
Shinu
Top achievements
Rank 2
 answered on 09 Mar 2009
1 answer
233 views
I have a radgrid that uses gridboundcolumns with filtering.  I need to be able to automatically filter "contains" when the user tabs out of the filter box (or focus is lost to the filter box).  I've searched but can't seem to find a solution.  Any help would be greatly appreciated.
Here is the grid, just in case it's needed:
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataRamps" GridLines="None">  
            <PagerStyle Mode="NextPrevNumericAndAdvanced" ShowPagerText="true" /> 
            <MasterTableView DataSourceID="SqlDataRamps" PageSize="15">  
                <RowIndicatorColumn Visible="False">  
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </RowIndicatorColumn> 
                <ExpandCollapseColumn Visible="False" Resizable="False">  
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </ExpandCollapseColumn> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="TRANSFER_POINT_ID" HeaderText="Ramp ID" SortExpression="TRANSFER_POINT_ID" 
                        UniqueName="TRANSFER_POINT_ID" Display="False" Resizable="False">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="NAME" HeaderText="Ramp Name" SortExpression="NAME" 
                        UniqueName="NAME">  
                        <FooterStyle Width="225px" /> 
                        <HeaderStyle Width="225px" /> 
                        <ItemStyle Width="225px" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="CITY" HeaderText="City" SortExpression="CITY" 
                        UniqueName="CITY">  
                        <FooterStyle Width="100px" /> 
                        <HeaderStyle Width="100px" /> 
                        <ItemStyle Width="100px" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="STATE" HeaderText="State" SortExpression="STATE" 
                        UniqueName="STATE">  
                        <FooterStyle Width="50px" /> 
                        <HeaderStyle Width="50px" /> 
                        <ItemStyle Width="50px" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="STATION_CODE" HeaderText="Station" SortExpression="STATION_CODE" 
                        UniqueName="STATION_CODE">  
                        <FooterStyle Width="50px" /> 
                        <HeaderStyle Width="50px" /> 
                        <ItemStyle Width="50px" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="CARRIER_NAME" HeaderText="Carrier" SortExpression="CARRIER_NAME" 
                        UniqueName="CARRIER_NAME">  
                        <FooterStyle Width="225px" /> 
                        <HeaderStyle Width="225px" /> 
                        <ItemStyle Width="225px" /> 
                    </telerik:GridBoundColumn> 
                </Columns> 
                <EditFormSettings> 
                    <PopUpSettings ScrollBars="None"></PopUpSettings> 
                </EditFormSettings> 
            </MasterTableView> 
            <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">  
                <Selecting AllowRowSelect="True" /> 
                <ClientEvents OnRowSelected="RowSelected" OnRowDblClick="RowDblClick" /> 
            </ClientSettings> 
        </telerik:RadGrid> 



Shinu
Top achievements
Rank 2
 answered on 09 Mar 2009
1 answer
77 views
Hi,

 during my work on performance in our application I have noticed that a lot (2s ;-) ) is taken by SaveViewState method for charts. We have 3 charts, which are repainted very often and this could be a possibility to improve it.

Can You explain me how is it working and what is saved in that view state method? Can it be disabled anyway?

Great thanks
M.
Vladimir Milev
Telerik team
 answered on 09 Mar 2009
3 answers
87 views

Hi,

In my application i have a radChart include in a RadMultipage who is associated with a RadTabStrip. After that, if i'm changing some UI element, i always received the error message "Error 2 RadMultiPage1:Cannot create an object of type 'Telerik.Charting.Styles.ChartMargins' from its string representation '54px, 82px, 27px, 38px' for the 'Margins' property. D:\Visual Studio 2005\Projects\QwebPRJ\IMPAQ.PRJ.WebApplication\Controls\MilestoneSummary.ascx IMPAQ.PRJ.WebApplication
" , someone knows how i can correct this behavior ? I'm using the designer to build this ui so i dont think it is a tag problem but i'm not sure what can else  can generated this error.

Thanks in advance for your helps.

Vladimir Milev
Telerik team
 answered on 09 Mar 2009
1 answer
141 views

Hi,

I have a pivot data which is exactly in the radgrid example of displaying pivot data. (Grid/Examples/Programming/Pivot/DefaultCS.aspx)
1. How can I change the font of row 3, column 2 and 3 in the pivot data?
2. How can I insert a button in row 4 of the pivot data?

Can anyone suggest me a way to do so in vb?

Thank you for your help.

 

 

Princy
Top achievements
Rank 2
 answered on 09 Mar 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?