Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
137 views
I setup this telerik grid with ajax.  The filter and sort work perfectly for all columns.  Here is the caviate I have two buttons on the page one to export to excel and the other to word.  If you press either button the filter options do not come up again until you refresh the page.  If you refresh the page your sort and filters disappear making this a frustrating problem. 

Thanks for the reply

Charley
Princy
Top achievements
Rank 2
 answered on 23 Jun 2008
2 answers
118 views
I need to see if anyone has any input or help they can give me.  I am using the export capabilities of the RadGrid and it exports fine but I need to find out if I can get any word highlighting that I have built into the dataset to be exported through the RadGrid export functions.

I am doing a regex search for words in a particular column in the dataset.  Then I wrap that text in a span tag with css to make word appear highlighted.  Then I bind it to the radgrid.

I would have thought that since the datatable had the html within the column information before it is bound to the radgrid it would show up in the exported documents of at least Word or Excel, and hoped it would for PDF as well but it is not showing.  Does anyone have any thoughts or ideas I might try to fix this problem.

Thanks,

Corey Hambrick
Daniel
Telerik team
 answered on 23 Jun 2008
1 answer
91 views
When I created a skin for my radgrid I select EnableEmbeddedSkins="false". But when I use a GridDropDownColumn it has no skin to it. So I just set the GridDropDownColumn to DropDownControlType="DropDownList".

What do I do in this instance if I want to use a skin for GridDropDownColum and set it to DropDownControlType="RadComboBox"?
Princy
Top achievements
Rank 2
 answered on 23 Jun 2008
1 answer
103 views
I have a RadTabStrip, and am dynamically loading page views on deman when the user clicks on each tab ( using the telerik example as a guide ).

The problem is that the RadGrid does not maintain the selected row across postbacks.

For example, if I dyanmically load a page view with a grid inside of it, and click the row, the row is selected.

When I click on a different tab, it does an async postback to generate the pageview contents.  All works fine.

However, when I click back to the previous tab with the RadGrid, the tab is no longer selected.

Is there something I need to do in order to maintain the selected row in this use case?
Shinu
Top achievements
Rank 2
 answered on 23 Jun 2008
2 answers
137 views
 am experiencing difficulty doing any edits/inserts/deletes on child tables within the grid obj.
using the sample provided that displays hierarchal tables. http://www.telerik.com/demos/aspnet/prometheus/Grid/Examples/Hierarchy/ThreeLevel/DefaultCS.aspx
i removed the third child as it was redundant to the issue - you will note the allowAutomaticUpdates is enabled, along with the gridEditCommanColumn.  thoughts on why this would not work?
 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadGrid ID="RadGrid1" Skin="Office2007" ShowGroupPanel="True" ShowStatusBar="True" 
            runat="server" DataSourceID="SqlDataSource1" Width="95%" AutoGenerateColumns="False" 
            PageSize="3" AllowSorting="True" AllowPaging="True" GridLines="None">  
            <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle> 
            <MasterTableView Width="100%" DataSourceID="SqlDataSource1"   
            DataKeyNames="CustomerID" AllowMultiColumnSorting="True">  
                <DetailTables> 
                    <telerik:GridTableView AllowAutomaticUpdates="true" DataSourceID="SqlDataSource2"   
                    Width="100%" runat="server">  
                        <ParentTableRelation> 
                            <telerik:GridRelationFields DetailKeyField="CustomerID"   
                            MasterKeyField="CustomerID" /> 
                        </ParentTableRelation> 
                        <Columns> 
                        <telerik:GridEditCommandColumn ButtonType="PushButton">  
                        </telerik:GridEditCommandColumn> 
                            <telerik:GridBoundColumn SortExpression="OrderID" HeaderText="OrderID" DataField="OrderID" UniqueName="OrderID">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn SortExpression="OrderDate" HeaderText="Date Ordered" DataField="OrderDate" UniqueName="OrderDate">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn SortExpression="EmployeeID" HeaderText="EmployeeID" DataField="EmployeeID" UniqueName="EmployeeID">  
                            </telerik:GridBoundColumn> 
                        </Columns> 
                    </telerik:GridTableView> 
                </DetailTables> 
                <Columns> 
                    <telerik:GridBoundColumn SortExpression="CustomerID" HeaderText="CustomerID" DataField="CustomerID" UniqueName="CustomerID">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn SortExpression="ContactName" HeaderText="Contact Name" DataField="ContactName" UniqueName="ContactName">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn SortExpression="CompanyName" HeaderText="Company" DataField="CompanyName" UniqueName="CompanyName">  
                    </telerik:GridBoundColumn> 
                </Columns> 
            </MasterTableView> 
            <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">  
                <Resizing AllowRowResize="True" AllowColumnResize="True"></Resizing> 
            </ClientSettings> 
        </telerik:RadGrid>&nbsp;<br /> 
        <br /> 
          
<asp:SqlDataSource ID="SqlDataSource1"   
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 
            ProviderName="System.Data.SqlClient" 
            SelectCommand="SELECT * FROM Customers" runat="server"></asp:SqlDataSource> 
<asp:SqlDataSource ID="SqlDataSource2"   
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"   
            SelectCommand="SELECT * FROM [Orders] WHERE ([CustomerID] = @CustomerID)" runat="server"   
            DeleteCommand="DELETE FROM [Orders] WHERE [OrderID] = @OrderID"   
            UpdateCommand="UPDATE [Orders] SET  [EmployeeID] = @EmployeeID, [OrderDate] = @OrderDate   
            WHERE [OrderID] = @OrderID"> 
            <SelectParameters> 
                <asp:SessionParameter Name="CustomerID" SessionField="CustomerID" Type="String" /> 
            </SelectParameters> 
    <DeleteParameters> 
        <asp:Parameter Name="OrderID" Type="Int32" /> 
    </DeleteParameters> 
    <UpdateParameters> 
        <asp:Parameter Name="EmployeeID" Type="Int32" /> 
        <asp:Parameter Name="OrderDate" Type="DateTime" /> 
        <asp:Parameter Name="OrderID" Type="Int32" /> 
    </UpdateParameters> 
     
        </asp:SqlDataSource> 
        </asp:Content> 
Princy
Top achievements
Rank 2
 answered on 23 Jun 2008
10 answers
218 views
Hi

Im having problem when filter the grid.Im having my grid inside the ajax panel and export button also inside the ajax panel.I have enabled paging,sorting and filtering in grid.Initially the filter option is working fine.when i click the export button and save the exported excel to local.after that click the filter,the filter option (Start with,EndsWith,EqualTo...) not displaying why? other than filter paging,sorting is working fine.After export the grid if i click the paging or sorting that is working fine.after that click the filter option its comes properlly.After export the grid then click the filter that point only filter options not displaying.can any one tell me why?
Princy
Top achievements
Rank 2
 answered on 23 Jun 2008
4 answers
146 views
Hi,

I'm trying to switch an image in relation to a string within the database for one of the columns in a Grid. So that if if the database field is equal to 'medium' a yellow flag is displayed in the column. I got it to work (the images display in relation to the database), however if there is data in the sub field then it throws and error when I try to expand the row. the exact error reads" ArgumentException was unhandled- Priority is neither a datacolumn nor a datarelation for table default view"

aspx code
OnItemDatabound="Rad2_ItemDataBound" 
 
 
</telerik:GridBoundColumn> 
   <telerik:GridTemplateColumn UniqueName="PriorityProject" Groupable="false"  
           DataField="Priority" HeaderText="Priority"> 
   <HeaderStyle Width="20px" /> 
   <ItemStyle Height="35px" /> 
   <ItemTemplate> 
   <asp:Image ID="PriorityProject" Boarderwidth="0px" runat="server" ImageUrl='<% Eval "images/icons/" & Trim(objRow("Priority")) & ".png" %>' AlternateText="PriorityFlag" style="float:right;" /> 
    
   </ItemTemplate> 
   </telerik:GridTemplateColumn> 

VB code
 Protected Sub Rad2_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles Rad2.ItemDataBound 
        If e.Item.ItemType = GridItemType.Item Or e.Item.ItemType = GridItemType.AlternatingItem Then 
            Dim objRow As DataRowView 
            objRow = e.Item.DataItem 
            Dim tmpImage As Image 
 
            tmpImage = CType(e.Item.FindControl("PriorityProject"), Image) 
            tmpImage.ImageUrl = "images/icons/" & Trim(objRow("Priority")) & ".png" 
        End If 
 
    End Sub 

thanks in advance, I'm kind of stumped on how to resolve the error as it displays but wont expand
Shinu
Top achievements
Rank 2
 answered on 23 Jun 2008
2 answers
163 views
Hello,

How would I cancel out of in-place edit mode when I click on insert a new row?  And vice-versa?

Cheers,
Timothy Grant VOgelsang
Shinu
Top achievements
Rank 2
 answered on 23 Jun 2008
1 answer
179 views
Hi, how do you fire the LOD NodeExpand event to force new children to be loaded and expanded on a single click (rather than the built-in doubleclick or click-on-lefthand-plussign)? Your LOD code is:

Protected Sub RadTreeView1_NodeExpand(ByVal sender As Object, ByVal e As RadTreeNodeEventArgs) 
   Const sql As String = "SELECT Items.ItemID AS NodeId, Items.Name AS NodeText, COUNT(Children.ItemID) AS ChildCount FROM Items LEFT JOIN Items As Children ON Items.ItemID = Children.ParentId WHERE Items.ParentId = @parentId GROUP BY Items.ItemID, Items.Name" 
   Dim connection As New OleDbConnection(Properties.Settings.[Default].AccessConnection) 
   Dim adapter As New OleDbDataAdapter(sql, connection) 
   adapter.SelectCommand.Parameters.AddWithValue("parentId", e.Node.Value) 
   Dim dataTable As New DataTable() 
   adapter.Fill(dataTable) 
   For Each row As DataRow In dataTable.Rows 
    Dim node As New RadTreeNode() 
    node.Text = row("NodeText").ToString() 
    node.Value = row("NodeId").ToString() 
    If Convert.ToInt32(row("ChildCount")) > 0 Then 
     node.ExpandMode = TreeNodeExpandMode.ServerSide 
    End If 
    e.Node.Nodes.Add(node) 
   Next 
   e.Node.Expanded = True 
   e.Node.ExpandMode = TreeNodeExpandMode.ClientSide 
  End Sub 

It doesn't matter if a server-side call is made, after all the data is needed to load so there is something to expand, otherwise using ClientNodeClicked to fire a node.toggle won't work because there's nothing loaded. Tried firing it from clientside (thought the node.expand may fire the serverside) but to no avail:

<script language="javascript"> 
function ClientNodeClicked(sender, eventArgs) 
{ 
   var node = eventArgs.get_node(); 
   node.Expand(); 
   node.toggle();      
   return true; 
} 
</script> 

Have tried the serverside methods to no avail:

Public Sub RadTree1_OnServerNodeClicked(ByVal o As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles RadTree1.NodeClick 
            e.Node.ExpandChildNodes() 
            e.Node.ExpandParentNodes() 
            e.Node.Selected = True 
            e.Node.Expanded = True 
            RadTree1.SelectedNode.ExpandChildNodes() 
            RadTree1.SelectedNode.ExpandParentNodes() 
            RadTree1.SelectedNode.Expanded = True 
End Sub 

So, can you fire the NodeExpand (with appropriate arguments), triggered by the client singleclick on the node? This would seem to be the most efficient (codewise) way, as other threads resort to callback panels etc and I can't see why this should be necessary. After all, if a double-click or click-on-plussign can fire it, why can't a single click?
Phil C
Top achievements
Rank 2
 answered on 22 Jun 2008
2 answers
213 views

I have a rad grid that i'm doing a custom inline edit on, and when I press the save button, i'm trying to do a client side validation of some of the fields.  But the OnClientClick event seems to be completely blocking the post back.  Any ideas?

protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)  
{  
 
            if (e.Item is GridEditFormItem && e.Item.IsInEditMode)  
            {  
                 Button bs = editFormItem.FindControl("btnSave") as Button;  
                bs.OnClientClick = "return validateChanges('" + m_Value+ "');";  
            }  
}  
 
 

and the javascript function right now I just have
function validateChanges(val)
{
     return true;
}

but it never posts.  Any ideas?

my asp button is this:

<asp:Button ID="btnSave" CssClass="buttonSmall" runat="server" Text="Save" CommandName="Update"/>

always works till i put in the OnClientClick property

Andy F.
Top achievements
Rank 1
Iron
 answered on 22 Jun 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?