Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
220 views
Hello,
I'm attempting to perform server side filtering on a RadGrid.  I'm trying to follow your examples on filtering as well as some blog posts found here and here.  On intial page load I load the Grid using a SQL data set. This loads fine.  I then load filters for the status column of "All, Active, and Working".  These values match exactly to what is returned in the data. When I click on the filter for the status column the server side event is called but the data is removed from the grid. 
Can you tell me what I'm doing wrong?
thanks
pete

ASPX
<rad:RadGrid id="RadGrid1" 
 OnItemCreated="RadGrid1_ItemCreated" 
 OnPreRender="RadGrid1_PreRender" 
 OnItemCommand="RadGrid1_ItemCommand"                                 
 ShowStatusBar="true" runat="server" AllowPaging="False" AllowSorting="True"
 AllowMultiRowSelection="True" AutoGenerateColumns="false"  
 ClientSettings-Resizing-ResizeGridOnColumnResize="false" 
 EnablePostBackOnRowClick="true"
 Width="100%"   Height="92%"  Skin="Windows7" AllowFilteringByColumn="true" EnableLinqExpressions="false">
        <MasterTableView PageSize="10" Width="100%" TableLayout="Fixed" EnableViewState="false">
              <Columns>                        
                    <rad:GridTemplateColumn UniqueName="CheckBoxTemplateColumn"  
                                           HeaderStyle-Width="10%" 
                                           HeaderStyle-HorizontalAlign="Center" 
                                           AllowFiltering="false">
                                               <HeaderTemplate>
                                                <asp:CheckBox id="headerChkbox" Text="Select All" OnCheckedChanged="ToggleSelectedState" AutoPostBack="True" runat="server"></asp:CheckBox>
                                               </HeaderTemplate>
                                               <ItemTemplate >
                                                   <asp:CheckBox id="CheckBox1" OnCheckedChanged="ToggleRowSelection" AutoPostBack="True" runat="server" Width="65"></asp:CheckBox>
                                               </ItemTemplate>                                            </rad:GridTemplateColumn>                                                         <rad:GridBoundColumn 
                                               DataField="DISCUSSION" 
                                               DataType="System.String" 
                                               HeaderText="Discussion"    
                                               Visible="False"                                                   
                                               UniqueName="DISCUSSION">
                                               <ItemStyle />
                                           </rad:GridBoundColumn>                        
                                           <rad:GridBoundColumn 
                                               DataField="KEY" 
                                               DataType="System.String" 
                                               HeaderText="ID"                                                 Visible="True"                                                   
                                               UniqueName="KEY"
                                                 
                                               HeaderStyle-HorizontalAlign="Center" 
                                               ItemStyle-HorizontalAlign="Center" 
                                               AllowFiltering="false">
                                               <ItemStyle />
                                           </rad:GridBoundColumn>
                                           <rad:GridBoundColumn 
                                               DataField="NAME" 
                                               DataType="System.String" 
                                               HeaderText="Name"                                                       
                                               UniqueName="NAME" 
                                               HeaderStyle-HorizontalAlign="Center" 
                                               ItemStyle-HorizontalAlign="Center" 
                                               HeaderStyle-Width="40%" 
                                               AllowFiltering="false">
                                               <ItemStyle />
                                           </rad:GridBoundColumn>
                                                                                       <rad:GridBoundColumn 
                                               DataField="STATUS" 
                                               DataType="System.String" 
                                               HeaderText="Status"                                                       
                                               UniqueName="STATUS"                                               
                                               SortExpression="STATUS"                                                
                                               ShowSortIcon="true"  
                                               HeaderStyle-HorizontalAlign="Center" 
                                               ItemStyle-HorizontalAlign="Center" 
                                               HeaderStyle-Width="10%" 
                                               AllowFiltering="true"
                                               AutoPostBackOnFilter="true" >
                                               <ItemStyle />
                                               <FilterTemplate>                                                    
                                                   <rad:RadComboBox ID="RadComboBoxStatus"  OnSelectedIndexChanged="FilterCombo_SelectedIndexChanged" 
                                                       DataTextField="STATUS" 
                                                       AutoPostBack="true"
                                                       DataValueField="STATUS" Width="70px"                                                          
                                                       runat="server" 
                                                       AppendDataBoundItems="true">                                                         <Items>                                                             <rad:RadComboBoxItem Text="All"  Value="All" /> 
                                                           <rad:RadComboBoxItem Text="Active"  Value="Active"/> 
                                                           <rad:RadComboBoxItem Text="Working" Value="Working" />  
                                                                                 
                                                       </Items>
                                                   </rad:RadComboBox>                                                   
                                               </FilterTemplate>
                                           </rad:GridBoundColumn>
                                                                                                                                                                          </Columns>
                                   </MasterTableView>
                                   <ClientSettings EnableRowHoverStyle="true" 
                                                   Resizing-AllowColumnResize="true"
                                                   Resizing-AllowRowResize="true"  
                                                   Resizing-EnableRealTimeResize ="false" 
                                                   Resizing-ResizeGridOnColumnResize="false" 
                                                   Resizing-ClipCellContentOnResize ="false">                                                    
                                       <Scrolling AllowScroll ="true" UseStaticHeaders="true" />
                                       <ClientEvents OnColumnResized="OnColumnResized" />                                        
                                   </ClientSettings>
                                   <PagerStyle Mode="Slider"></PagerStyle>
                               </rad:RadGrid>

CS
protected void FilterCombo_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) 
    {
        string filterExpression;
        filterExpression = "([STATUS] = \'" + e.Text + "\')";
        RadGrid1.MasterTableView.FilterExpression = filterExpression;
        RadGrid1.MasterTableView.Rebind();
    }
Pete
Top achievements
Rank 1
 answered on 17 Dec 2010
2 answers
75 views
how to set the cell alignment in export pdf
Daniel
Telerik team
 answered on 17 Dec 2010
2 answers
180 views
How can I create a tooltip on a menu item?

Here's how I'm creating the menu right now...
for(var i=0; i< menuItems.length; i++){
                    var item = menuItems[i];   
                 
                    var newItem = new Telerik.Web.UI.RadMenuItem(); //Create a new Menu Item
                    newItem.set_text(item.Text);
                    newItem.set_value(item.Value);
                    newItem.set_expandMode(item.ExpandMode);
                    newItem.set_navigateUrl(item.NavigateUrl);
 
                    _menu.get_items().add(newItem); //Add the item to the collection
                }

sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 17 Dec 2010
1 answer
117 views
Anyone successfully use the Mega Drop-Down menu in DotNetNuke? I realize it can't be dynamic but wondering what the best approach is. Would I create a skin object, etc?
Digital Man
Top achievements
Rank 2
 answered on 17 Dec 2010
1 answer
83 views
All,

Is there a way to set the combobox to re-run the webservice when the box is focused on, on the client side?  My implementation involves a possibility for a user to have text in the box, go to another control on the page, and then use the Tab key to regain focus on the control.  The problem I'm running into is that when the comboBox receives focus, it's not re-running the webservice.

Is this even possible?
Thanks!
-Luke
Kalina
Telerik team
 answered on 17 Dec 2010
10 answers
392 views
Good Morning,
if I set the "OutputCompression" in the RadScriptManager Control to "AutoDetect" or "Forced" there is no different in the size of the "Telerik.Web.UI.WebResource.axd" File (about 500kb!!!).

I have everytime the same Filesize of 500kb, what ever which value ("Disabled", "AutoDetect" or "Forced") I use.

My System:
Win 2008 Server
IIS 7
Telerik 2009.2.701.35

Any ideas how to fix that? Must I configure something else to enable the OutputCompression?

Thanks in advance.

Regards Dirk
Helen
Telerik team
 answered on 17 Dec 2010
1 answer
153 views

I have followed this simple example and implemented similarly:-

http://www.telerik.com/help/aspnet-ajax/tree_databindinghierarchical.html

The problem:- GetDataSet() method returns a DataSet with the complete Ques table with all the rows and columns(QuesID,QuesParentID,QuesAns,Active,QuesTypeID and so on)

Now the probelm is that the RadTreeview is not binding well. Like The root node displays Questions but the the child nodes are not displaying the correspoding answer. Also, some root nodes do not have a child node at all. Those root nodes that DO have a child node are displaying Questions as their text and not Answers. I surmise it's something wrong with the BindTree() method only. What could it be? I mean RADTreeView is implemented in a very simple manner in that link above. I only followed accordingly. What is wrong??

aspx page;-

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<telerik:RadTreeView runat="server" ID="tree1" OnNodeDataBound="tree1_NodeDataBound"></telerik:RadTreeView>

</asp:Content>

Code Behind :-

 public partial class TestTree :
   
System.Web.UI.Page {
       
protected void Page_Load(object sender, EventArgs e)
       
{
           
if (!IsPostBack)
           
{
               
BindTree(tree1);
           
}
       
}

       
private DataSet GetDataSet()
       
{
            bllQues objbllQues
= new bllQues();
           
var ds = new DataSet();
           
return objbllQues.GetQues();

       
}

       
protected void BindTree(RadTreeView treeView)
       
{
           
DataSet ds = new DataSet();
            ds
= GetDataSet();
            tree1
.DataTextField = "Ques";
            tree1
.DataValueField = "QuesAns";
            tree1
.DataFieldID = "QuesID";
            tree1
.DataFieldParentID = "QuesParentID";
            tree1
.DataSource = ds;
            tree1
.DataBind();
       
}

       
protected void tree1_NodeDataBound(object sender,
   
RadTreeNodeEventArgs e)
       
{
            e
.Node.ToolTip = (e.Node.DataItem as
   
DataRowView)["QuesAns"].ToString();
       
} }

Cori
Top achievements
Rank 2
 answered on 17 Dec 2010
1 answer
123 views
Hi,

Is there any way to globally assign a node image dependent on if it's a parent or not?

I have code the sets the image based on the node.count for each node, but after re-binding the datasource, the RadControls blow-up.  It's almost as if the prior datasource is still being enumerated.

Anyway, if there's a better way for me to do this, rather than walking through the entire tree, I'd appreciate the knowledge.

Thanks,
Cori
Top achievements
Rank 2
 answered on 17 Dec 2010
3 answers
284 views
Is there a way to cancel the click on a menu item in the OnClientItemClicked event?

The documentation says you can by returning a false from the handler but I can seem to get it to work.

Here is a routine i wrote to cancel the postback if the user hits the cancel button on the confirm window 

function RADItemClicked(sender, eventArgs)
{
    var item = eventArgs.get_item();
    if(item.get_text()=="Save Changes") {
        if (!confirm("Save Changes?")) { return false }
    }
   
}

Not sure what im doing wrong. Any advise would be appreciated.

TIA
Helen
Telerik team
 answered on 17 Dec 2010
1 answer
751 views
Hi,

I have a radgrid where the columns are programmatically created which are having textboxes in detail grid. Upon clicking, a specific text box, popup window with another text box will appear and the user have to enter values in the text box. Upon closing the popup window, the value entered in the text box from the popup window needs to be populated in the text box which was clicked initially. I'm having trouble getting the value. Is there any way that I could achieve that. (Note: I cannot change the data entry concept because it is the user requirement). Thanks in advance.
Shinu
Top achievements
Rank 2
 answered on 17 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?