Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
150 views
Hello,

I am using radcontols for asp.NET and they enabled me to create nice application in quite short time (thanks!). But currently I'm faced one problem:

 I tryied to implement column hiding based on user selection (and store this selection for user into his custom profile). But when some column is initialy hidden and than I try to show it the headers of radgrid (CommandItemTemplate, groupHeader) do not use the space that appears after column showing.
 Is this a known behavior? - if no, I can send a small piece of code demonstrating it. And is there some work-around for it? (I was trying to put columns in a <div> in templates and then set style.display property, but this hide content of column, but column itself is still there (even if 1px wide, but it doesn't seem very nice)).

Thank you
Jan
Sebastian
Telerik team
 answered on 19 Sep 2008
3 answers
105 views
So I am creating rad dock zones dynamically and the rad docks dynamically as well.

I want to store in a db the dockzone that the dock is stored in

each dock represents an employee and each zone represents a schedule.

I build each dockzone with this code
RadDockZone buildDocs(DataRow dr)  
    {  
        RadDockZone thisDoc = new RadDockZone();  
        thisDoc.ID = dr["schedule_rec"].ToString();  
        thisDoc.Height = 50;  
        thisDoc.Width = 280;  
        return thisDoc;  
    } 

I build each doc with this code
DataView dv = (DataView)SqlDataSource2.Select(DataSourceSelectArguments.Empty);  
        DataTable dt = dv.ToTable();  
        foreach (DataRow dr in dt.Rows)  
        {  
            RadDock thisDoc = new RadDock();  
            thisDoc.ID = dr["UserID"].ToString();  
            thisDoc.Height = 50;  
            thisDoc.DockMode = DockMode.Docked;  
            thisDoc.Collapsed = true;  
            thisDoc.Title = dr["firstName"].ToString() + " " + dr["lastName"].ToString();  
            thisDoc.DefaultCommands = Telerik.Web.UI.Dock.DefaultCommands.None;            
            radZoneEmployees.Controls.Add(thisDoc);  
        } 

So I want to store the UserID and the sched_rec in the database however  can't seem to find them or there relationship.

Anyhelp?
Obi-Wan Kenobi
Top achievements
Rank 1
 answered on 19 Sep 2008
1 answer
155 views
Hi

I know that my case must be really simple but i dont find the solution ..... I have a TemplateColomn in my grid, in the EditItemTemplate of  this colomn i have a radcombo box that is bind to a second ObjectDataSource (my grid is also bind to objectDataSource), and everything is great but in the ItemTemplate i have to put a label but i cant find how to bind it to the combobox datasource  because i dont want to display the integer value includes in my grid datasource..... I just want to bind the data like is it the cas in the automatic operations. Sorry for my bad english.... :(

Thanks

Dominic
Top achievements
Rank 2
 answered on 19 Sep 2008
1 answer
49 views
Hi

I have the RadUpload and RadProgressArea controls getting displayed in a popup window. The default dimensions of RadProgresArea are too big to be contained completely within the popup.

Is there a way to customize the dimensions and look of RadProgressArea control so that it fits better?

Rgds
Shuchi
Veselin Vasilev
Telerik team
 answered on 19 Sep 2008
13 answers
2.2K+ views
I'm trying to set up custom filtering in the radgrid.  I've read through the documentation and the examples and have had a hard time piecing them together.  Each example seems to have different code and I can't really comprehend them or get them to work. 

What I want it to look like is:
http://www.telerik.com/demos/aspnet/Grid/Examples/Programming/FilteringTemplateColumns/DefaultCS.aspx  but this code has no c# or vb code, so it's not very usable. 

I found this simple example in one of the forum threads, and it works well in displaying the dropdown list with the data populated, however I cannot get the  combo_SelectedIndexChanged event to fire. 

Here's the applicable code behind:
    protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)  
    {  
 
          
 
        if (e.Item is GridFilteringItem)  
        {  
            GridFilteringItem item = (GridFilteringItem)e.Item;  
            item["loc"].Controls.Clear();  
            RadComboBox combo = new RadComboBox();  
            combo.ID = "RadComboBox1";  
 
            combo.Items.Add(new RadComboBoxItem("", ""));  
            combo.Items.Add(new RadComboBoxItem("Main Page", "1"));  
            combo.Items.Add(new RadComboBoxItem("Left Nav", "2"));  
            combo.AutoPostBack = true;  
            combo.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(combo_SelectedIndexChanged);  
            item["loc"].Controls.Add(combo);  
 
 
 
            //RadAjaxManager1.AjaxSettings.AddAjaxSetting(combo,RadGrid1);  
 
        }    
 
    }  
 
    void combo_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)  
    {  
        RadComboBox combo = (RadComboBox)sender;  
        RadGrid1.MasterTableView.FilterExpression = "([loc_id] = '" + combo.SelectedValue + "') ";  
        GridColumn column = RadGrid1.MasterTableView.GetColumnSafe("loc");  
        column.CurrentFilterFunction = GridKnownFunction.EqualTo;  
 
 
        RadGrid1.Rebind();  
    }   

Here is the aspx code for the grid:

 <telerik:RadAjaxManager EnableAJAX="true" ID="RadAjaxManager1" runat="server">    
        <AjaxSettings>    
            <telerik:AjaxSetting AjaxControlID="RadGrid1">    
                <UpdatedControls>    
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />    
                </UpdatedControls>    
            </telerik:AjaxSetting>    
            <telerik:AjaxSetting AjaxControlID="Button1">    
                <UpdatedControls>    
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />    
                </UpdatedControls>    
            </telerik:AjaxSetting>    
        </AjaxSettings>    
    </telerik:RadAjaxManager>   
 
      
    <telerik:RadGrid ID="RadGrid1" runat="server" OnItemDataBound="RadGrid1_ItemDataBound" 
        AllowFilteringByColumn="True" AllowSorting="True"   
        GridLines="None" Skin="Office2007" Width="400px"   
        OnNeedDataSource="RadGrid1_NeedDataSource"   
        OnUpdateCommand="RadGrid1_UpdateCommand" OnInsertCommand="RadGrid1_InsertCommand" 
        OnItemCommand="RadGrid1_ItemCommand" 
    > 
 
        <MasterTableView autogeneratecolumns="False" AllowFilteringByColumn="True" commanditemdisplay="Top" editmode="InPlace" DataKeyNames="zone_id"  > 
            <RowIndicatorColumn Visible="False">  
            <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
 
            <ExpandCollapseColumn Visible="False" Resizable="False">  
            <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
 
        <Columns> 
            <telerik:GridEditCommandColumn> 
            </telerik:GridEditCommandColumn> 
            <telerik:GridCheckBoxColumn DataField="status" DataType="System.Boolean" ItemStyle-HorizontalAlign="Center" 
                HeaderText="status" SortExpression="status" UniqueName="status" > 
                <ItemStyle HorizontalAlign="Center"></ItemStyle> 
            </telerik:GridCheckBoxColumn> 
            <telerik:GridBoundColumn DataField="order_by" DataType="System.Int32" ItemStyle-Width="30px" 
                HeaderText="order_by" SortExpression="order_by" UniqueName="order_by"   
                AllowFiltering="False">  
                <ItemStyle Width="30px"></ItemStyle> 
            </telerik:GridBoundColumn> 
            <telerik:GridTemplateColumn HeaderText="Category Name"   
                SortExpression="category_name" UniqueName="category_name"   
                AllowFiltering="False"  > 
                <ItemTemplate> 
                    <asp:Label runat="server" ID="lbCategory" Text='<%#Eval("category_name") %>' /> 
                </ItemTemplate> 
                <EditItemTemplate> 
                    <asp:DropDownList ID="ddlCategory" runat="server" Width="150px" /> 
                </EditItemTemplate> 
            </telerik:GridTemplateColumn> 
            <telerik:GridBoundColumn DataField="zone_id" DataType="System.Int32" 
                HeaderText="zone_id" ReadOnly="True" SortExpression="zone_id"   
                UniqueName="zone_id" Display="false" > 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="loc_id" DataType="System.Int32"    
                HeaderText="loc_id" SortExpression="loc_id" UniqueName="loc_id" Display="false" > 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="loc" HeaderText="loc" ItemStyle-Width="60px" 
                SortExpression="loc" UniqueName="loc" ReadOnly="True" AllowFiltering="False">  
                <ItemStyle Width="60px"></ItemStyle> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="id_type" HeaderText="id_type" ItemStyle-Width="60px" 
                SortExpression="id_type" UniqueName="id_type" ReadOnly="true">  
                <ItemStyle Width="60px"></ItemStyle> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="category_id" DataType="System.Int32"   
                HeaderText="category_id" SortExpression="category_id" UniqueName="category_id"   
                Display="false">  
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="site_name" HeaderText="site_name" ReadOnly="true" 
                SortExpression="site_name" UniqueName="site_name">  
            </telerik:GridBoundColumn> 
              <telerik:GridBoundColumn DataField="site_id" DataType="System.Int32"   
                HeaderText="site_id" SortExpression="site_id" UniqueName="site_id"   
                Visible="False">  
            </telerik:GridBoundColumn> 
              
              
              
 
                  
        </Columns> 
 
      
 
<EditFormSettings EditFormType="WebUserControl" UserControlName="AdminUC/BannerZoneInsert.ascx">  
<EditColumn UniqueName="EditCommandColumn1"></EditColumn> 
 
<PopUpSettings ScrollBars="None"></PopUpSettings> 
</EditFormSettings> 
</MasterTableView> 
    </telerik:RadGrid> 

Please note I have the "allowfiltering=false" set in the "loc" column to prevent the viewstate errors that occur when manually adding a filter control.  Also, this grid is ajax-enabled, do I need to somehow add the combo box control to the ajax events?  If so, how would I do that.

Am I missing something else to get this code to work?  Or is it impossible to have custom filters without using that MyCustomFilteringColumn class.  And if I must use that class, can someone please provide a thorough example along the lines of what I have up there, with kind of an explanation?  I would really appreciate it. 

It's been kind of frustrating trying to wade through all the disparate documentation to get a working product.   I would appreciate some direction.

Thanks!

-Angie
Dave
Top achievements
Rank 1
 answered on 19 Sep 2008
1 answer
96 views

Peter
Telerik team
 answered on 19 Sep 2008
1 answer
73 views
So I am creating rad dock zones dynamically and the rad docks dynamically as well.

I want to store in a db the dockzone that the dock is stored in

each dock represents an employee and each zone represents a schedule.

I build each dockzone with this code
RadDockZone buildDocs(DataRow dr)  
    {  
        RadDockZone thisDoc = new RadDockZone();  
        thisDoc.ID = dr["schedule_rec"].ToString();  
        thisDoc.Height = 50;  
        thisDoc.Width = 280;  
        return thisDoc;  
    } 

I build each doc with this code
DataView dv = (DataView)SqlDataSource2.Select(DataSourceSelectArguments.Empty);  
        DataTable dt = dv.ToTable();  
        foreach (DataRow dr in dt.Rows)  
        {  
            RadDock thisDoc = new RadDock();  
            thisDoc.ID = dr["UserID"].ToString();  
            thisDoc.Height = 50;  
            thisDoc.DockMode = DockMode.Docked;  
            thisDoc.Collapsed = true;  
            thisDoc.Title = dr["firstName"].ToString() + " " + dr["lastName"].ToString();  
            thisDoc.DefaultCommands = Telerik.Web.UI.Dock.DefaultCommands.None;            
            radZoneEmployees.Controls.Add(thisDoc);  
        } 

So I want to store the UserID and the sched_rec in the database however  can't seem to find them or there relationship.

Anyhelp?
Rick
Top achievements
Rank 1
 answered on 19 Sep 2008
4 answers
242 views
Hello

I'm using some templates in my radGrid, in this templates I have a Textbox inside, when I click in the row I throw the SelectedIndexChanged method, but when I click in the textbox I want to select this row and throw the selectedIndexChanged method also.

How can I do this?

Thanks.
Iosu Buenetxea
Top achievements
Rank 1
 answered on 19 Sep 2008
1 answer
132 views
Hi,

I am currently using the telerik scheduler with an advance edit template. and I put in some validation in my code. I read the online help, it shows that I can cancel my edit after clicking an edit button just by inserting a simple code

Protected Sub EquipmentScheduler_AppointmentUpdate(ByVal sender As Object, ByVal e As Telerik.Web.UI.AppointmentUpdateEventArgs) Handles EquipmentScheduler.AppointmentUpdate
             e.cancel = true
End Sub


that works, it stopped me from going back to scheduler and remain in the advance form, but somehow, the data inside the advance form that has been bind is not showing on my form.

is there anything i have to add in my code, so that the data will remain the same?
Peter
Telerik team
 answered on 19 Sep 2008
12 answers
183 views
Problem 1. Sorted images (using skin), it is very large when rendered.

Problem 2. When i clicked to sort first column, the first column will then apply with sortedbackcolor, however when i clicked to sort second column, the first column did not clear the sortedbackcolor.

I have tested in IE7 and Opera 9.25. How to solve? Thank you.

I had attached the screenshot. You have to download from free file server here.
fquinty
Top achievements
Rank 1
 answered on 19 Sep 2008
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?