Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
206 views
Hi everybody,

I try to add Columns to a RadGrid dynamically and I'm able to do it, but, when i do a post back
the RadGrid's columns are reinitialized and i don't want it. i want that my RadGrid stay
as it was before postback. Why? i want to save the columns' position and if the RadGrid
is reinitialized, I can't it.

Example:

RadGrid Status (initial):

Column1 Column2 Column3

User changes the columns' order:

Column3 Column2 Column1

User does post back and RadGrid come back to status initial.

Column1 Column2 Column3

If i do that in a page aspx (which not inherits of a masterpage), my code works, but
with a masterPage doesnt work. someone has an idea?

It's a very simple thing but i tried to do it and I'm not be able, i read all forums and i do all, but that not works in a page which inherits of a master page.

Someone can help me?

My RadGrid's code:
                                <telerik:RadGrid ID="RadGrid2" runat="server" AllowPaging="false"  
                                    EnableLinqExpressions="false" GridLines="None"  AutoGenerateColumns="false"  
                                        Skin="InductDefault" EnableEmbeddedSkins="false"  
                                        onneeddatasource="RadGrid2_NeedDataSource"
                                    <MasterTableView AutoGenerateColumns="False" EnableNoRecordsTemplate="false"  
                                        HierarchyDefaultExpanded="false" HierarchyLoadMode="Client" Width="100%"
                                    </MasterTableView> 
                                    <ClientSettings AllowColumnHide="true" AllowColumnsReorder="true"  
                                        ReorderColumnsOnClient="true"
                                    </ClientSettings> 
                                </telerik:RadGrid> 

C# code:

    protected void page_Init(object sender, EventArgs e) 
    { 
        if (!IsPostBack) 
        { 
            createRadGrid2(); 
        } 
    } 
 
    public void createRadGrid2() 
    { 
        XDocument xmlDoc = XDocument.Load(RadGridXmlConfig); 
        var Columns = xmlDoc.Elements("Columns"
                              .Elements("Column"
                              .Attributes("uniqueName"); 
 
        foreach (var colTemp in Columns) 
        { 
            String uniqueName = colTemp.Value; 
            tableTripsDetail.Columns.Add(uniqueName); 
            RadGrid2.MasterTableView.Columns.Add(createBoundColumn(uniqueName)); 
        } 
    } 
 
    protected void RadGrid2_NeedDataSource(object source, GridNeedDataSourceEventArgs e) 
    { 
        RadGrid2.DataSource = getTableReportTripsDetail(); 
    } 
 
    private GridBoundColumn createBoundColumn(String valueUnique) 
    { 
        GridBoundColumn BoundColumn = new GridBoundColumn(); 
        BoundColumn.DataField = valueUnique; 
        BoundColumn.HeaderText = valueUnique; 
        BoundColumn.SortExpression = valueUnique; 
        BoundColumn.UniqueName = valueUnique; 
 
        return BoundColumn; 
    } 

Veli
Telerik team
 answered on 28 Dec 2009
0 answers
176 views
Hi there,
1) Iam using a Radgrid which consists of '4' image columns on page load it is getting loaded fine but when I perform any Filter option which is provided with grid it is taking time for getting loaded for image columns remaining columns load quickly  same with page index also is not getting loaded.Iam using a timer for page it is set for 3 minutes after that only the page is getting loaded after that only the image columns or showing I want to get to be loaded when i perform any operation.

2) And Iam facing another problem with grouping it is grouping properly when i drag some times it is grouped but some times not in this also image columns are not getting loaded when iam ungrouping it is throwing an exception.

3) I want Tooltip for Radgrid for all columns It should display according to database.

Here's my code
------------------------------------------------------------------------------------------
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="uclTaskGrid.ascx.cs" Inherits="uclTaskGrid"  %>
  <%@ Register assembly="msgBox" namespace="BunnyBear" tagprefix="cc2" %>
  <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
  <script language="javascript" type="text/javascript"> 
  function FireMyIASGroupPrint(myURL){
   if(myURL)
     {
    
    window.open("RejectTaskStatus.aspx?taskID=" + myURL ,'_blank','left = 300, top=150, width=600, height=200,menubar=no , scrollbars=no, resizable=no');
    
     }
}



     
    </script>
<asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick" Interval="12000">
</asp:Timer>
<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
        <td valign="top" height="6"></td>
        </tr>
<tr>
        <td height="30" align="left">&nbsp;&nbsp;&nbsp;<b>Project name</b>&nbsp;<asp:DropDownList ID="ddlProjects" CssClass="text" runat="server" AutoPostBack="True" 
        onselectedindexchanged="ddlProjects_SelectedIndexChanged">
    </asp:DropDownList>
            
        </td>
    <td align="right">
    <table width="160" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>
                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                    <ContentTemplate>
                        <asp:Label ID="lblRecCount" CssClass="LabelText" runat="server" 
    Text="Total Record(s): 14"></asp:Label>
                    </ContentTemplate>
                </asp:UpdatePanel>
            &nbsp;&nbsp;&nbsp;</td>
          </tr>
</table>
</td>
</tr>
  <tr>
        <td valign="top" colspan="2" height="5">
            &nbsp;</td></tr>  
<tr>
        <td valign="top" align="center" colspan="2">
    <table cellpadding="0" cellspacing="0" border="0" width="98%">
    <tr>
    <td align="left" valign="top">    
           
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                     <Triggers>  
                        <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />  
                    </Triggers> 
                        <ContentTemplate>
                            <telerik:RadGrid ID="gviewTasks" runat="server" AllowFilteringByColumn="True" 
        AllowPaging="True" AllowScroll="True" EnableVirtualScrollPaging="True" 
                                PageSize="10" AllowSorting="True" GridLines="None" ShowGroupPanel="True" 
            style="top: 300px; left: 10px;" 
        AutoGenerateColumns="False" Skin="Vista" onitemcommand="gviewTasks_ItemCommand" 
                                onitemdatabound="gviewTasks_ItemDataBound" AutoGenerateHierarchy="True" AllowCustomPaging="True" 
                                
         >
        
<MasterTableView>


<columns>
          <telerik:GridBoundColumn DataField="TaskID" HeaderText="ID" />           
                      
<telerik:GridBoundColumn DataField="Resource Name" HeaderText="Resource Name" 
              HeaderStyle-Width="80px"  >
    <HeaderStyle Width="80px" />
          </telerik:GridBoundColumn>
 <telerik:GridTemplateColumn HeaderText="Task Name" AllowFiltering="false" Groupable="false" HeaderStyle-Width="50px" >
                       <ItemTemplate>
                       <asp:LinkButton ID="lnkTask" runat="server" CommandName="select"></asp:LinkButton>
                       </ItemTemplate>
                       <HeaderStyle Width="50px" />
                       </telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="Task Name" HeaderText="TaskName"  />
<telerik:GridBoundColumn DataField="Description" HeaderText="TaskDescription" 
              HeaderStyle-Width="80px"  >
    <HeaderStyle Width="80px" />
          </telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Phase" HeaderStyle-Width="50px" AllowFiltering="false" Groupable="false"  > 
            <ItemTemplate>
                <asp:Label ID="lblphase" runat="server"  Text='<%#DataBinder.Eval(Container.DataItem,"Phase") %>'></asp:Label> &nbsp;
               </ItemTemplate>
               <HeaderStyle Width="50px" />
               </telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="Project Name" HeaderText="Project" 
              HeaderStyle-Width="50px" AllowFiltering="false" >
    <HeaderStyle Width="50px" />
          </telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="AssignedBy" HeaderText="Assigned By" 
              HeaderStyle-Width="75px"  >
    <HeaderStyle Width="75px" />
          </telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Estimated Hours" HeaderText="ETA [Hrs]" 
              HeaderStyle-Width="50px"  >
    <HeaderStyle Width="50px" />
          </telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Date" HeaderText="Date" HeaderStyle-Width="75px"  >
    <HeaderStyle Width="75px" />
          </telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Status" HeaderText="Status" HeaderStyle-Width="75px" >
    <HeaderStyle Width="75px" />
          </telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Approve Status" HeaderText="Approval Status" 
              HeaderStyle-Width="75px"  >

    <HeaderStyle Width="75px" />
          </telerik:GridBoundColumn>

<telerik:GridTemplateColumn HeaderText="Approve" AllowFiltering="false" Groupable="false" HeaderStyle-Width="40px" >
                       <ItemTemplate>
                                            
                       <asp:ImageButton ID="imgbtnactivate" runat="server" ImageUrl="~/images/activate.gif" CommandName="Approve" OnClientClick="return confirm('Are you sure you want to approve this task?');"></asp:ImageButton>
                       
                       </ItemTemplate>
                       <HeaderStyle Width="40px" />
                       </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn HeaderText="Reject" AllowFiltering="false" Groupable="false" HeaderStyle-Width="30px" >
                       <ItemTemplate>
                                            
                       <asp:ImageButton ID="imgbtndeactivate" runat="server" ImageUrl="~/images/de-activate.gif" CommandName="Reject" OnClientClick="return confirm('Are you sure you want to reject this task?');"></asp:ImageButton>
                       
                       </ItemTemplate>
                            <HeaderStyle Width="30px" />
                            </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn HeaderText="Forward" AllowFiltering="false" Groupable="false" HeaderStyle-Width="40px">
                       <ItemTemplate>
                                            
                       <asp:ImageButton ID="imgforward" runat="server" ImageUrl="~/images/forward.gif" CommandName="Select1"></asp:ImageButton>
                       
                       </ItemTemplate>
                           <HeaderStyle Width="40px" />
                       </telerik:GridTemplateColumn>  
                        <telerik:GridBoundColumn DataField="ResourceID"/>                                  
                       <telerik:GridTemplateColumn HeaderText="Delete" AllowFiltering="false" Groupable="false" HeaderStyle-Width="30px">
                       <ItemTemplate>
                                            
                       <asp:ImageButton ID="imgdelete" runat="server"    ImageUrl="~/images/delete-icon.gif" CommandName="deleteTask" OnClientClick="return confirm('Are you sure you want to delete the task?');"></asp:ImageButton>
                       
                       </ItemTemplate>
                           <HeaderStyle Width="30px" />
                       </telerik:GridTemplateColumn>
                      
                       
</columns>

</MasterTableView>
<ClientSettings EnableRowHoverStyle="true">
                <Selecting AllowRowSelect="true" />
                <Scrolling EnableVirtualScrollPaging="True" UseStaticHeaders="True" />
                <Resizing AllowColumnResize="True" />
            </ClientSettings>
        <ClientSettings AllowDragToGroup="True" AllowExpandCollapse="true">
            <Scrolling EnableVirtualScrollPaging="True" UseStaticHeaders="True" />
            <Resizing AllowColumnResize="True" />
        </ClientSettings>
                                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="Blue" />
                                <PagerStyle Height="30px" HorizontalAlign="Center" Font-Bold="True" 
                                    Font-Names="Arial" Font-Size="Smaller" />
                                <HeaderStyle BorderStyle="None"  Font-Bold="True" 
        Height="30px" />
                            </telerik:RadGrid>
                              
                        </ContentTemplate>
                    </asp:UpdatePanel></td></tr>
                    </table>
              
</td>
</tr></table>
-------------------------------------------------------------------------------------
here's the code for tooltip
-------------------------------------
 protected void gviewTasks_ItemDataBound(object sender, GridItemEventArgs e)
    {
        int index;
        try
        {
            if (e.Item.ItemType == GridItemType.CommandItem )
            {

                index = e.Item.RowIndex + (gviewTasks.PageSize * gviewTasks.PageSize);
                for (int i = 0; i < e.Item.Cells.Count; i++)
                {
                    if (dtTemp.Rows.Count > 0)
                    {
                        e.Item.Cells[0].ToolTip = dtTemp.Rows[index]["Resource Name_Org"].ToString();
                        e.Item.Cells[2].ToolTip = dtTemp.Rows[index]["Task Name_Org"].ToString();
                        e.Item.Cells[3].ToolTip = dtTemp.Rows[index]["Task Name_Org"].ToString();
                        e.Item.Cells[4].ToolTip = dtTemp.Rows[index]["Description_Org"].ToString();
                        e.Item.Cells[5].ToolTip = dtTemp.Rows[index]["Phase_Org"].ToString();
                        e.Item.Cells[6].ToolTip = dtTemp.Rows[index]["Project Name_Org"].ToString();
                        e.Item.Cells[7].ToolTip = dtTemp.Rows[index]["AssignedBy_org"].ToString();
                        e.Item.Cells[8].ToolTip = dtTemp.Rows[index]["Estimated Hours_org"].ToString();
                        e.Item.Cells[9].ToolTip = dtTemp.Rows[index]["Date_Org"].ToString();
                        e.Item.Cells[10].ToolTip = dtTemp.Rows[index]["Status_Org"].ToString();
                        e.Item.Cells[11].ToolTip = dtTemp.Rows[index]["Approve Status_Org"].ToString();
                    }
                }
            }

        }
        catch (Exception ex)
        {
        }

    }

----------------------------------------------------------------------------------------------------
ratan mishra
Top achievements
Rank 1
 asked on 28 Dec 2009
1 answer
130 views
Hello community,

I was trying to create a series of Treeview controls and arrange them to create an NCAA Bracket.  Of course, ideally, I would like to minimize the number of controls on a webpage, but I didn't get too far.  My thought was have a treeview on the left (if looking at the image attached, say UNC vs Mt. St. Mary's) and using client-side code - move the selected team over to another treeview control off to the right (round 2) - in the appropriate node.  So, the UNC/MSM winner would go as the top node in round two, the Indiana/Arkansas winner would go to node two.  I was able to get the text of the selected node in round one using javascript, but was unable to add it to another treeview (for round two).  In the end, all the selections would be saved to SQL Server.

Has anyone ever tried this?

Thanks in advance!

Kevin
Kamen Bundev
Telerik team
 answered on 28 Dec 2009
3 answers
155 views
Hello,

I'm using the EmptyMessageStyle-BorderColor and I'm using the EmptyMessageStyle-BackColor properties of the RadInput control and would like to apply the same style and functionality to a RadComboBox.  How would I go about adding the border and backcolor styles when a user has not selected an item in the combobox?  Thanks!!
Yana
Telerik team
 answered on 28 Dec 2009
11 answers
240 views
Hi Telerik,
I upgraded to SP2 and now my Application makes the following JavaScript error after clicking a RadToolBar Button:
Here is the debugged Code:
...var $create=Sys.Component.create=function(h,f,d,c,g){var a=g?new h(g):new h,...(in the Debugging, h is undefined)
I know, it's cryptic, but I don't know where to begin searching...

Regards,
Andreas

Veselin Vasilev
Telerik team
 answered on 28 Dec 2009
4 answers
289 views
Hi,
I'm using a RadDateInput control. The Culture is set to English(United States) and Dateformat, DisplayDate format are set to MM/yyyy.
When I run the application if I enter a value like 03/2010 on leaving the control the value is set to 05/2010 (the month part is being replaced by the current month). How can I fix this problem?

I don't need a date value; I just want the month and year from the user which will be stored in database in MM/yyyy fomat (varchar).
Appreciate any one has a solution for this. (I've even tried with RadDatePicker; the behavior is same as the RadDateInput)

Thanks.

Regards,
Prashanth

Princy
Top achievements
Rank 2
 answered on 28 Dec 2009
1 answer
124 views
Hello Support,

 We are using the  telerik Tabstrip in my project. In that I want to show the image on the individual tab instead of normal tab. I have overwrite the existing style with my images. But the image is not placing correctly.(http://jettest.jetliving.com/images/inner_tab.png).
I am not getting the curve as like in image in Tab. Please look the below url for Demo.

http://jettest.jetliving.com/AreaLanding.aspx

With expecting reply

Thanks

Mohamed




Yana
Telerik team
 answered on 28 Dec 2009
5 answers
100 views

I am using Telerik 2009 Q2 release.
I have a WinGrid where a put all records in Edit Mode. The only editable item on a row is a checkbox. I only want the user to be able to check the checkbox as nessary. Because all rows are in edit mode a line is displayed underneath each row. I do not want this line displayed. I believe I should be able to suppress the line by the following code - but is is not working. The EditItemStyle-BorderStyle="None" should suppress the line.

<

 

MasterTableView DataKeyNames="WorkCategorySubTypeDamageExtentID"  

CommandItemDisplay="None"   

EditMode="InPlace" GroupHeaderItemStyle-HorizontalAlign="Left"   

AllowSorting ="True" DataSourceID="ManageDamageExtentSelect" ShowHeader="True" ShowFooter="True"
EditItemStyle-BorderStyle="None" >

Thanks for any help.

Chris

 

 

 

 

Daniel
Telerik team
 answered on 28 Dec 2009
1 answer
129 views
Hello,

I am looking for ideally a sample project or some guidance on how to have a clients-side caching for a Rad Grid that can be filtered using html anchor passed in URL. (something like what you get in Gmail, ie: http://mail.google.com/mail/?ui=2&shva=1#inbox   or  http://mail.google.com/mail/?ui=2&shva=1#search/Telerik)
I have seen the sample projects and demo for client-caching and also filtering. Below I have explained a scenario of what I want to achieve:

I get the data from database using one of these methods(Linq, WebService.asmx or WebDataService.svc) and then Cache it so paging or filtering should not require anymore call to database. (Sample code: http://demos.telerik.com/aspnet-ajax/grid/examples/performance/linq/defaultcs.aspx)

Now I want to have a separate search box (Not the default RadGrid Filter templates) like in Gmail. Only that I am interested to search on one field which is customer name shown in my grid.
Now is there a way that using JavaScript on the client side I can get the grid data, search on one of the column (Customer Name) and bound the filtered result back to the grid again. I would like to pass the search result as html anchor in the url, something like this:
http://www.mySite.com/default.aspx#Search/David 
or, if not possible
http://www.mySite.com/default.aspx?Search=David 

So the main is how to access the cached data in javascript, filter it and bound it again to the RadGrid.
Any idea, hope I have explained this clearly.

Many thanks
Nikolay Rusev
Telerik team
 answered on 28 Dec 2009
1 answer
126 views
Hi...

-- Is there a way to import into RadEditor a user's control selection? The control selection might be from a RadListBox, RadGrid or ListView. 

-- I am needing to select and import nvarchar(max) items... normally 2 to 3 sentence blocks of text .

-- I tried using the snippet and custom toolbar dropdowns but it is tough to distinguish between the various items when the dropdown is activated.

Thoughts?

Brad
Dobromir
Telerik team
 answered on 28 Dec 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
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
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?