Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
223 views
Hi,

I'm testing RadGrid filters and I have problems with template filters.

I want to have a template filter for a column binded to a datetime datafield, for filtering between two dates. The template has these controls:
    - a Date picker for start date.
    - a Date picker for end date.
    - a button to apply/clear the filter.

These are pieces of the code I'm using:

- ASPX:
...
    <telerik:GridBoundColumn DataField="DateTimeFieldDB"
        DataType="System.DateTime"
        FilterControlAltText="Filter DateTimeFieldDB column"
        HeaderText="Date/Time" SortExpression="DateTimeFieldDB"
        UniqueName="DateTimeCol" HeaderButtonType="LinkButton">
        <HeaderStyle Width="150px" />
                    <FilterTemplate>
                        <telerik:RadDatePicker ID="FromDT" runat="server" Width="70px"/>
                        <telerik:RadDatePicker ID="ToDT" runat="server" Width="70px"/>
                        <telerik:RadButton ID="btnFilterDT" runat="server" Text="Filter" CommandName="cmdFilterDT">
                        </telerik:RadButton>
                    </FilterTemplate>
    </telerik:GridBoundColumn>
...


- CS:
protected void myGrid_ItemCommand(object sender, GridCommandEventArgs e)
 {
     switch (e.CommandName)
     {
         case "cmdFilterDT":
             GridColumn column = myGrid.MasterTableView.GetColumnSafe("DateTimeCol");
 
             GridItem[] fItems = myGrid.MasterTableView.GetItems(GridItemType.FilteringItem);
             RadDatePicker dpFrom = (RadDatePicker)fItems[0].FindControl("FromDT");
             RadDatePicker dpTo = (RadDatePicker)fItems[0].FindControl("ToDT");
             string sDateFrom = string.Format("{0: dd/MM/yyyy}", dpFrom.SelectedDate);
             string sDateTo = string.Format("{0: dd/MM/yyyy}", dpTo.SelectedDate);
 
             if (dpFrom.SelectedDate.ToString() != string.Empty && dpTo.SelectedDate.ToString() != string.Empty)
             {
                 column.CurrentFilterFunction = GridKnownFunction.Between;
                 column.CurrentFilterValue = string.Format("{0} {1}", sDateFrom, sDateTo);
             }
             else
             {
                 column.CurrentFilterFunction = GridKnownFunction.NoFilter;
                 column.CurrentFilterValue = "";
             }
 
             myGrid.MasterTableView.Rebind();
             break;
     }
 }


When I click the filter button the command is fired and the code for 'cmdFilterDT' is executed, but no changes are displayed in the grid (I have a rule from myGrid to myGrid in an RadAjaxManager for refreshing the changes).

Anyone can help me? I've been reading the help and the grid forum but I don't find any solution to this method for using template filters.

Thanks in advance,
John.



john
Top achievements
Rank 1
 asked on 20 Jul 2011
5 answers
142 views
It would be nice to have context menu on the columns of the grid that define which columns display (like windows explorer does). 

Does the RadGrid support this or does anybody know a way this can be easily done?
Sebastian
Telerik team
 answered on 20 Jul 2011
0 answers
147 views
hi dear telerik team :
my 2 radcomboboxes codes is like below :

<telerik:RadComboBox ID="RadcbCustomersEmail" runat="server" DataSourceID="sdsCustomers"
    DataTextField="Email" DataValueField="ID" EnableEmbeddedSkins="false" Skin="VistaByMe"
    ValidationGroup="A" Width="244px" CausesValidation="False"
    MaxHeight="150px" AppendDataBoundItems="True" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged_RadcbCustomersEmail">
    <Items>
        <telerik:RadComboBoxItem runat="server" Text="plz choose..."
            Value="-1" />
    </Items>
</telerik:RadComboBox>
 
 
<telerik:RadComboBox ID="RadcbCustomersMobile" runat="server" DataSourceID="sdsCustomers"
    DataTextField="Mobile" DataValueField="ID" EnableEmbeddedSkins="false" Skin="VistaByMe"
    ValidationGroup="A" Width="244px" CausesValidation="False"
    MaxHeight="150px" AppendDataBoundItems="True" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged_RadcbCustomersMobile">
    <Items>
        <telerik:RadComboBoxItem runat="server" Text="plz choose..."
            Value="-1" />
    </Items>
</telerik:RadComboBox>

and javascript codes :

 
function OnClientSelectedIndexChanged_RadcbCustomersEmail(sender, eventArgs) {
    var MobileCombo = $find("<%= RadcbCustomersMobile.ClientID %>");
    var ComboItem = MobileCombo.findItemByValue(sender.get_selectedItem().get_value());
    MobileCombo.trackChanges();
    if (ComboItem != null)
        ComboItem.select();
    MobileCombo.commitChanges();
}
 
function OnClientSelectedIndexChanged_RadcbCustomersMobile(sender, eventArgs) {
    var EmailCombo = $find("<%= RadcbCustomersEmail.ClientID %>");
    var ComboItem = EmailCombo.findItemByValue(sender.get_selectedItem().get_value());
    EmailCombo.trackChanges();
    if (ComboItem != null)
        ComboItem.select();
    EmailCombo.commitChanges();
}


my syntax is ok , but i have a logical error about these codes / it seems there is a loop here / how can i prevent this loop?

thanks in advance
best regards
Majid Darab
Top achievements
Rank 1
 asked on 20 Jul 2011
4 answers
231 views
Hi,
I want to display percentage as float number with 2 digit for fraction and a % sign after that in radgrid. How to do it? Thanks.
Princy
Top achievements
Rank 2
 answered on 20 Jul 2011
1 answer
125 views
I was wondering if RadUpload control has a built-in "upload via url" feature. I know i can use HttpWebRequest/Response classes but would be nice if you just paste the image url to the radupload and let it take care about the rest.

Peter Filipov
Telerik team
 answered on 20 Jul 2011
0 answers
140 views


I use radlistview paging like that ,
http://demos.telerik.com/aspnet-ajax/listview/examples/paging/custompaging/defaultcs.aspx
but my problem's two page values are there but , only one page only show ,
<telerik:RadDataPager ID="RadDataPager1" runat="server" Style="border: none;" PageSize="2">
                                                           <Fields>
                                                               <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                                                               <telerik:RadDataPagerButtonField FieldType="Numeric" />
                                                               <telerik:RadDataPagerButtonField FieldType="NextLast" />
                                                               <telerik:RadDataPagerGoToPageField />
                                                           </Fields>
                                                       </telerik:RadDataPager>

refer the image below
Thanks,
Mohamed.
mohamed
Top achievements
Rank 1
 asked on 20 Jul 2011
0 answers
103 views
Hello,

       I have used Rad Grid on my web page, I had applied Virtual Paging on my radgrid, my page size is 30 for radgrid, After page loaded grid have 210 records ,so there would be 7 total pages, i have put down the grid into the rad pane so initially there are 15 visible records available.Now, the problem with virtual pagins is when scroll the page user will get rest of the records but when user reach up to 25 records, automatically paging get applied and come to the second page means records will display from 31-60...so in that case user can't able to view the records 26-30 those are the part of First Page. How can i manage the index of the records or any other solution to resolve this issue. same thing happen while i am editing any records which are near to paging (i.e. record 28 or 29).

Thanks,
Kaushal.
Kaushal
Top achievements
Rank 1
 asked on 20 Jul 2011
0 answers
122 views
Hi Team,

i use Chart, AjaxManager, Xmldatasource andTimer. my chart auto refresh every 10 seconds. but always show error

"Sys.WebForms.PageRequestManagerTimeoutException:The Server request timed out".

my data as much as 1610 lines for load in chart.

Please help me.....
Heri .
Top achievements
Rank 1
 asked on 20 Jul 2011
0 answers
34 views
I have a radgrid in a RadTabStrip which is enclosed in radAjaxPanel. For radGrid multirowselection is true and clientsetting row select is false. I am selecting the row server side with a checkbox checkedchanged event as explained in server side row selection demo. If I select 5-6 rows then all the selections are lost but the checkboxes are still checked. What can I do to fix the problem. If I select only 2-3 rows, all remain selected.
Please let me know some solution, its urgent.

Thanks

kachy
Top achievements
Rank 1
 asked on 20 Jul 2011
2 answers
123 views

I added three custom buttons to my RadEditor.

---------------------------------

Added the following to my xml file:

 

<tools name="CustomToolbar" dockable="true" enabled="true">

    <tool name="DatabaseSave" />

    <tool name="Open-Print" />

    <tool name="Email" />

</tools>


Added the following to my markup:
<style type="text/css">

    .reTool .DatabaseSave

    

        background-image: url(save.gif);

    }

    .reTool .Open-Print 

    {

        background-image: url(printer.ico);

    }

    .reTool .Email

    

        background-image: url(email.gif);

    }

</style>

  

<telerik:RadEditor ID="RadEditor1" Runat="server" 

ToolsFile="~/Letters/DocMaster/ToolsFile.xml" EditModes="Design" AutoResizeHeight="True" 

ClientIDMode="Inherit" Skin="Hay" Width="100%" />

  

<script type="text/javascript">

    Telerik.Web.UI.Editor.CommandList["Save"] = function (commandName, editor, args) {

        alert("Pressed Save");

    };

  

    Telerik.Web.UI.Editor.CommandList["Open-Print"] = function (commandName, editor, args) {

        alert("Pressed Open-Print");

    };

  

    Telerik.Web.UI.Editor.CommandList["Email"] = function (commandName, editor, args) {

        alert("Pressed Email");

    };

</script>

---------------------------------

The buttons showed with their default glippy no problem. The button press function calls came up no problem. I played with everything I could think of to get the background-image little graphics to show on the buttons using every path methodology I knew or could think of, including internal and external CSS. In my test project, I finally got them to show only by putting the graphics in the same folder as the page that holds the RadEditor. So I incorporated it into the real project. In the real project, the RadEditor is on a nested master page. Nothing I can do nohow will get those buttons to show, no matter where I put them or how I write those paths. Please help.

Thanks.

Velma
Top achievements
Rank 1
 answered on 19 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?