Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
229 views
I have written a javascript function which filters items in a radgrid depending on options that have been specified in a listbox by the user. This worked perfectly until I added a pager, which causes there to be less items on the page than the page size states. Is there anyway of, firstly accessing all rows in a grid (client-side) when a pager is in place, and secondly, forcing re-paging of the radgrid after rows have been hidden.

the javascript method i have implemented basically does this...

 

for (var i = 0; i < masterView.get_dataItems().length; i++) {
    var aCell= masterView.getCellByColumnUniqueName(masterView.get_dataItems()[i], "aCell")

 

 

 

    if (aCell!= null) {

 

 

        var cellValue = aCell.innerHTML;

 

 

 

        if (Exists(filterListbox.get_checkedItems(), cellValue) == false) {

 

            masterView.hideItem(i);

 

            continue;

 

        }
    }
    //now re-set paging so it still displays x items instead of x-(hidden item count)
 }

Konstantin Dikov
Telerik team
 answered on 18 Oct 2013
1 answer
56 views
Hi,
I need to create doctor wise slots can i do with app schedular
Plamen
Telerik team
 answered on 18 Oct 2013
1 answer
70 views


In my page I have used telerik grid with sorting functionality. In that I have a many columns with different datatype(Single, multiline, date, etc..)
I have a bulk of data, which I have updated day to day. In that grid, the sorting functionality is working fine for all types of columns but the column (Description) which has multiline text does not sort stable.
Example: Some data starts with number(1, 2 , ..) and Character(A, B, C, ..) and Special Character with/without number/character(1\2 , 1#, 1 D, etc..)
The sorting functionality is working fine for contents starts with both number and Character.(i.e  0, 1, 2, ...,9, A, B, C,... Z)
But the contents starts with Special Character with/without number/character is does not sort stable.
Example: 0, 1, 10, A, B....Z, 1/2, 1#, 2 D, A, B, ..Z(i.e its having two manner of sorting.. 0 to Z and again 1/2 to Z)

Pls can Anyone Help me


Thanks
Akila
Konstantin Dikov
Telerik team
 answered on 18 Oct 2013
4 answers
440 views
Hello my dear RadGrid friends!

In my project I implemented a RadGrid with a custom data access, nothing like all the examples provided (direct sql, etc.). Here's my NeedDataSource method:

        /// <summary> 
        /// Defining the PartnerListGrid's data, i.e. providing a datascource 
        /// </summary> 
        /// <param name="source"></param> 
        /// <param name="e"></param> 
        protected void PartnerListGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
        { 
            PartnerAgent partneragent = new PartnerAgent(); 
            Partner[] partners = partneragent.Load(); 
 
            if (!displayMessages(partneragent)) 
            { 
                var partnerselects = from p in partners 
                                     select new 
                                     { 
                                         ID = p.PartnerID, 
                                         Name = p.Name, 
                                         Type = p.Partnertype.Name, 
                                         Contacts = String.Join("<br />", p.Contacts.Select<Contact, String>(cn => String.Concat(cn.Prename, " ", cn.Name)).ToArray()), 
                                         Mainaddress = p.Mainaddress, 
                                         Links = new HyperLink[] { new HyperLink() { Text = "Projekte" }, new HyperLink() { Text = "Passwörter" }, new HyperLink() { Text = "Keys" }, new HyperLink() { Text = "PCs" }, new HyperLink() { Text = "Server" }, new HyperLink() { Text = "Domains" } } 
                                     }; 
 
                PartnerListGrid.DataSource = partnerselects; 
            } 
        } 

Now I want to get the provided row by in the DeleteCommand, but all I could find was a text-attribute from a cell containing something half-way similar like the DataItem.
Unfortunately, the DeleteCommand's DataItem is empty.
Looks like following:
        protected void PartnerListGrid_DeleteCommand(object source, GridCommandEventArgs e) 
        { 
            GridDataItem x = ((RadGrid)source).Items[e.Item.ItemIndex]; 
            var HereIsSomeDataAvailable = x.Cells[2].Text; 
             
            // HOW??? 
 
            /*var activerow = InformationAgent.CastByExample(x.Cells[2].Text, new { ID = Guid.Empty, Name = "", Type = "", Contacts = "", Mainaddress = "", Links = new HyperLink[] { new HyperLink() { Text = "test" }, new HyperLink() { Text = "test2" } } });
            PartnerAgent partneragent = new PartnerAgent();
            partneragent.deletePartner(activerow.ID);
            displayMessages(partneragent);*/ 
        } 

The part on the bottom, commented out, is my previous try, however, unfortunately the data from the cell is not convertable to the previously generated anonymous type.

Please tell me if you need any further data to provide help.
And also don't hesitate to tell me if I've chosen a wrong/chaotic way to work with the RadGrid ^^

Thanks in advance for your help!
Best
Roman



Kostadin
Telerik team
 answered on 18 Oct 2013
1 answer
114 views
I have a radscheduler starting from 04:00:00 am to 03:59:00 am tomorrow but the problem is when it display in appointment in monthview the appointment goes next day(See image) also how can i display that only for one day.
  
Plamen
Telerik team
 answered on 18 Oct 2013
5 answers
166 views
I need to pass some information across the tabs and save all that information to the database on the submit button.
I have some datatable and some other values that I need to pass on each tab.

I was trying to create a public property and access the properties on the last tab but those peoperties don't show up against the usercontrol.
Is it possible to access public properties? Is there any other way I can use the same datatable across all tabs?
RadMultiPage multiPage = (RadMultiPage)this.NamingContainer.FindControl("rmChange");
RadPageView pvStatus = multiPage.FindPageViewByID("Status");
Control ucStatus = pvMaritalStatus.FindControl("StatusUserControl");
Shinu
Top achievements
Rank 2
 answered on 18 Oct 2013
1 answer
168 views
Hello,
We use a grid with 2 levels with inline edit, and the same CancelImageUrl works fine on the first level, but not on the second level, where the default cancel image is always shown (see screenshot attached)

<radG:GridEditCommandColumn ButtonType="ImageButton" UniqueName="ChildEditCommandColumn" HeaderStyle-Width="3%" CancelImageUrl="~/App_Themes/Cerib/Images/Buttons/FlecheGauche.gif" />

Thanks
Princy
Top achievements
Rank 2
 answered on 18 Oct 2013
4 answers
139 views
Hi,

I'm trying to automatically refresh an image button to notify the users when thy get a a message in their internal inbox (db driven) by changing the original image by another one including an alert sign (like the iPhone red circle).

Also when the user click on that image button I would like to refresh the content of the user control to display the exact number of received messages.

<asp:ImageButton ID="BtnNotif" width="153" height="42" runat="server" />
 
<telerik:RadToolTip ID="RttNotifs" runat="server"
TargetControlID="BtnNotif" RelativeTo="Element"
ManualClose="true" ShowEvent="OnClick"
Position="BottomCenter" RenderInPageRoot="False"
 Skin="Hotlinexxx" EnableEmbeddedSkins="false"
 Width="300px" Height="200px" >                             
    <uc1:notifications runat="server" ID="notifications" />                     
</telerik:RadToolTip>

I don't know exactly how to do it and do not find any relevant example on the demo website, could you please let me know how you would take care of it ?

Thanks for your support,


Herve

Herve
Top achievements
Rank 2
 answered on 18 Oct 2013
4 answers
296 views
Hi,

Im using a custom filter and want to use my own filter function (wanted to use wildcard options like * and ?), I followed the indications of this link: http://www.telerik.com/help/aspnet-ajax/grid-custom-option-for-filtering.html and the custom filter works.

Nevertheless the grid keeps the previous filter values I used before, I mean, if I used the value "test*" for the name column it gets all the rows that the name starts with "test" but if I change the filter value and hit enter, the MasterTableView.FilterExpression value keeps the value of the filter I used before

Here is my code

aspx

<asp:SqlDataSource ID="ds" SelectCommand="SELECT * FROM table" runat="server"></asp:SqlDataSource>
<telerik:RadGrid ID="grd" runat="server" DataSourceID="ds" AutoGenerateDeleteColumn="false" AllowAutomaticDeletes="true" AllowFilteringByColumn="True" OnInit="RadGrid_Init" AllowMultiRowSelection="true" OnItemCreated="RadGrid_ItemCreated" OnItemCommand="RadGrid_ItemCommand">
 <ClientSettings>
    <Selecting AllowRowSelect="True"></Selecting>
    <ClientEvents OnRowSelected="Grid_RowSelected" OnRowDeselected="Grid_RowDeselected" />
</ClientSettings>
<MasterTableView ClientDataKeyNames="ID" AutoGenerateColumns="False">
<Columns>
    <telerik:GridBoundColumn DataField="Name" HeaderText="Event Name" CurrentFilterFunction="Custom" AutoPostBackOnFilter="true" ShowFilterIcon="false"></telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Year" HeaderText="Event Year" CurrentFilterFunction="EqualTo" AutoPostBackOnFilter="true" ShowFilterIcon="false"></telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>

c#
protected void RadGrid_ItemCommand(object source, GridCommandEventArgs e)
   {
 
       if (e.CommandName == RadGrid.FilterCommandName)
       {
           Pair filterPair = (Pair)e.CommandArgument;
           if (filterPair.First.ToString() != "EqualTo")
           {
               string colName = filterPair.Second.ToString();
               TextBox tbPattern = (e.Item as GridFilteringItem)[colName].Controls[0] as TextBox;
               string value = tbPattern.Text;
               if (value != string.Empty)
               {
                   e.Canceled = true;
                   string newFilter = string.Empty;
                   if (value.IndexOf("*") >= 0)  newFilter = "(([" + filterPair.Second + "] LIKE '" + value.Replace("*","%") + "'))";
                   else if (value.IndexOf("?") >= 0) newFilter = "(([" + filterPair.Second + "] LIKE '" + value.Replace("?", "%") + "'))";
                   else newFilter = "(([" + filterPair.Second + "] ='" + value + "'))";                
                   if (grd.MasterTableView.FilterExpression == "")
                   {
                       grd.MasterTableView.FilterExpression = newFilter;
                   }
                   else
                   {
                       grd.MasterTableView.FilterExpression = "((" + grd.MasterTableView.FilterExpression + ") AND (" + newFilter + "))";
                   }
                   grd.Rebind();
               }
           }
       }
   }

For instance, this is the value the grid is using after a couple of filter changes, the first value was 2010* and the second was *annu*.

 MasterTableView.FilterExpression = "(((([EventName] LIKE '2010%'))) AND ((([EventName] LIKE '%annu%'))))"

I if clear the filter textbox, hit enter and then enter the new filter value it does clear the MasterTableView.FilterExpression value

Thanks
Esteban
Top achievements
Rank 1
 answered on 17 Oct 2013
1 answer
155 views
I am trying to make a basic chart like http://www.telerik.com/help/aspnet-ajax/media/htmlchart-columnchart-simple-example.png

I am able to get it to mark up the chart with the Sales numbers, but I am not able to get the chart to show "Q1", "Q2", "Q3", etc as the name of the columns.

What do i have to do to show the column names on the chart?
Danail Vasilev
Telerik team
 answered on 17 Oct 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?