Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
81 views
Hi I get a tooltip text on mousehover on grid as 'Grid' , I dont want to show this.
How can I remove tooltip on mousehover , Please help me.
Shinu
Top achievements
Rank 2
 answered on 09 Feb 2011
5 answers
195 views
I have a grid that when put in edit mode has a popup editform that has another grid containing records with checkboxes in the grid column edit template. I want to add a checkbox in the header that when selected will toggle the checkboxes in all the rows to checked or unchecked. Here is the column definition in my editforms child grid:
<telerik:GridTemplateColumn UniqueName="Resubmitted" DataField="Resubmitted" 
                                        HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="20%" >
                                        <HeaderTemplate>
                                         <asp:CheckBox id="headerChkbox" OnCheckedChanged="ToggleSelectedState" AutoPostBack="true" runat="server" Text=" resubmitted" ></asp:CheckBox>
                                        </HeaderTemplate>
                                        <EditItemTemplate>
                                           <asp:CheckBox id="chkResubmittedEdit" runat="server" Checked='<%# Bind("Resubmitted") %>'/>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:CheckBox id="chkResubmittedItem" runat="server" Checked='<%# Eval("Resubmitted") %>' />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>

I am getting a null value when trying to access the items in the ToggleSelectedState method for the grid items. Here is my code-behind in c#:
protected void ToggleSelectedState(object sender, EventArgs e)
        {
            CheckBox headerCheckBox = (sender as CheckBox);
            try
            {
               GridDataItemCollection items = (grdClaimHist.FindControl("grdClaimDetail") as RadGrid).MasterTableView.Items;
                foreach (GridDataItem dataItem in items)
                {
                    CheckBox chk = (dataItem.FindControl("chkResubmittedEdit") as CheckBox);
                    chk.Checked = headerCheckBox.Checked;
                }
            }
            catch (Exception ex)
            {
                //continue
            }
        }
grdClaimHist is the parent grid that contains the editform  while grdClaimDetail is the child grid. Is there another way I should be trying to implement this functionality since the ToggleSelectedState method is called on my header checkbox click?


Princy
Top achievements
Rank 2
 answered on 09 Feb 2011
1 answer
53 views
Hi,

I am using nestedviewtemplate in my application. i am using checkbox in this nestedview template. so i want validate if this checkbox checked or not. so how to get these control in client side and validate.

Please give me a tips for this one.


Thanks,
Dhamu
Princy
Top achievements
Rank 2
 answered on 09 Feb 2011
1 answer
110 views

Hello, I have following RadGrid containing nested GridTableViews. Every row has CheckBox and I would like to select and deselect them in ClientSide. I have following Javascript code.

function RowSelected(sender, eventArgs) {
  
    var dataItem = sender.get_masterTableView().get_dataItems()[eventArgs._itemIndexHierarchical];
    var str = eventArgs._itemIndexHierarchical; 
  
    if (typeof (dataItem) == "undefined") {
        dataItem = sender.get_detailTables()[0].get_selectedItems()[str];
    }
  
    if (typeof (dataItem) == "undefined") {
        dataItem = sender.get_detailTables()[1].get_selectedItems()[str];
    }
  
  
    if (isDeselecting) {
        if (id == dataItem._itemIndexHierarchical) {
            dataItem.set_selected(false);
            isDeselecting = false;
        }
        else
            id = dataItem._itemIndexHierarchical;
    }
    else if (isDeselecting == false) {
        id = dataItem._itemIndexHierarchical;
        isDeselecting = true;
    }
}

 My aspx Page is declared as followed.

<telerik:RadGrid ID="RadGridSubOrganizations" runat="server" BorderStyle="Solid" AllowFilteringByColumn="false"
 AutoGenerateColumns="false" Visible="true" Width="100%" OnItemCommand="RadGridSubOrganizations_ItemCommand"   
 Height="150px" OnDetailTableDataBind="RadGridSubOrganizations_DetailTableDataBind" 
 OnItemDataBound="RadGridSubOrganizations_ItemDataBound" SortingSettings-EnableSkinSortStyles="true" 
 MasterTableView-ExpandCollapseColumn-Display="true" AllowSorting="false" 
 ShowStatusBar="true" GridLines="None" HeaderStyle-BackColor="#BDBDBD">
  
<MasterTableView CellSpacing="-1" AllowNaturalSort="false" TableLayout="Fixed" Name="Organization" 
  DataKeyNames="ParentOrganizationId,ChildOrganizationId,SubChildOrganizationId"
  ItemStyle-BackColor="#B0C4DE" GridLines="None">                                                                                       
 <HeaderStyle CssClass="HeaderColor" /> 
  
 <DetailTables>
    <telerik:GridTableView DataKeyNames="ParentOrganizationId,ChildOrganizationId" Width="100%" 
    GridLines="None" HeaderStyle-BackColor="#BDBDBD" HeaderStyle-ForeColor="Black" ItemStyle-BackColor="#ADD8E6">                                                                                   
    <DetailTables>                                              
    <telerik:GridTableView DataKeyNames="ParentOrganizationId,ChildOrganizationId,SubChildOrganizationId" Width="100%" 
     ItemStyle-BackColor="#DEF3FA" GridLines="None" HeaderStyle-BackColor="#BDBDBD" HeaderStyle-ForeColor="Black">                                                                                                                          

When event comes to javascript function index of row is in variable eventArgs._itemIndexHierarchical.
But if Row in GridTableView is selected eventArgs._itemIndexHierarchical contains mystic index like: 1:0_0:0_0_0 and exception is thrown when trying to get dataItem from GridTableView. How should I reference to index? Couldn't find any samples or documentation considering this.

How to do this?

Br

Michael

Princy
Top achievements
Rank 2
 answered on 09 Feb 2011
1 answer
131 views
How would I get the selected row on an outside event?

Much like the RowDblClick function below but I dont have sender or args.

Here is my user control.  I want to call OpenRow from a button click outside a grid event.
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="Grid.ascx.vb" Inherits="WebDBMS.Grid" %>
  
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
  
<telerik:RadScriptManager ID="ScriptManager" runat="server" />
<telerik:RadGrid ID="RadGrid" runat="server" Width="100%" Height="100%"
    Font-Names="Verdana" GridLines="Both" AllowSorting="True" ShowGroupPanel="True" 
    Skin="Office2007" AllowPaging="True" PageSize="50" AutoPostBack="True"
    <MasterTableView>
        <HeaderStyle Wrap="false" />
    </MasterTableView>
    <ClientSettings AllowDragToGroup="True"
        <Selecting AllowRowSelect="True" />
        <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True">
        </Scrolling
        <Resizing AllowResizeToFit="True" AllowColumnResize="True" />
        <ClientEvents OnRowDblClick="RowDblClick" />
    </ClientSettings>
    <ExportSettings ExportOnlyData="true" IgnorePaging="true"/>
</telerik:RadGrid>
<script type="text/javascript">
    function RowDblClick(sender, args) {
        var grid = sender;
        var MasterTable = grid.get_masterTableView();
        var row = MasterTable.get_dataItems()[args.get_itemIndexHierarchical()];
        var cell = MasterTable.getCellByColumnUniqueName(row, "ID");
        var value = cell.innerHTML;
  
        var url = "../Forms/getEditForm.aspx?key=" + __name + "&id=" + value;
        winopen(url, null, "toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1");
    }
  
    function OpenRow() {
        /*
        Need something here
        */
        var url = "../Forms/getEditForm.aspx?key=" + __name + "&id=" + value;
        winopen(url, null, "toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1");
    }
</script>
Princy
Top achievements
Rank 2
 answered on 09 Feb 2011
1 answer
284 views
I am attempting to hide a button in a radgrid template column based on a value selected from a sql query. Here is what I am attempting to accomplish.

I have two grids on a page (rgd_Authorizers) and (rgd_Approvals)

The rgd_Authorizers is a list of managers, each of whom must approve the page's information by clicking btn_approve contained in a template column. When they click btn_approve, I add a record to the approval table.

This record is then displayed in rgd_Approvals showing that that manager has approved the page.

The goal is to have the btn_approve to no longer be visible next to that manager's name in rgd_Authorizers so that they cannot re-approve the page.

Protected Sub rgd_Authorizers_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgd_Authorizers.ItemCreated
    Dim IDPurchaseRequisition = Request.QueryString("IDPurchaseRequisition")
    Dim connectionString As String = DirectCast(ConfigurationManager.ConnectionStrings("Purchasing_PRS_ConnectionString").ConnectionString, String)
    Dim conn As New SqlConnection(connectionString)
    Dim comm As New SqlCommand("SELECT * FROM [PRS_PurchaseRequisitionsApprovals] WHERE IDPurchaseRequisition = @IDPurchaseRequisition", conn)
    comm.Connection.Open()
    comm.Parameters.Add("@IDPurchaseRequisition", SqlDbType.Int).Value = IDPurchaseRequisition
    Dim myDataAdapter As New SqlDataAdapter(comm)
    Dim myDataSet As New DataSet
    Dim dtData As New DataTable
    Dim dtRow As DataRow
    myDataAdapter.Fill(myDataSet)
    conn.Close()
    For Each dtRow In myDataSet.Tables(0).Rows
        Dim IDAuthorizer = dtRow.Item("IDAuthorizer")
        If TypeOf e.Item Is GridDataItem Then
            Dim item As GridDataItem = TryCast(e.Item, GridDataItem)
            Dim value1 As String = item("IDAuthorizer").Text
            If value1 = IDAuthorizer Then
                Dim btn_Approve As Button = DirectCast(item("TemplateColumn").Controls(0), Button)
                btn_Approve.Visible = False
            End If
        End If
    Next
End Sub

Here is what I have attempted so far. I get no errors, however, the button is still visible. Any help much appreciated.
Shinu
Top achievements
Rank 2
 answered on 09 Feb 2011
5 answers
139 views
I would love to be able to use the Web Service binding for my RadScheduler. But like many, I need to display user-specific information in the RadScheduler and the provider model appears to offer no "hooks" to allow this

Consider the GetAppointments method. The examples given mandate the following:
[WebMethod]  
public IEnumerable<AppointmentData> GetAppointments(SchedulerInfo schedulerInfo)  
{  
 return Controller.GetAppointments(schedulerInfo);  
where the Controller is a facade for my custom SchedulerProvider.

In my application, the appointments returned vary according to who is making the call. I'm using ASP.NET forms authentication and I can discover who is calling the webservice by specifying the EnableSession attribute, e.g.
[WebMethod(EnableSession = true)]  
public IEnumerable<AppointmentData> GetAppointments(SchedulerInfo schedulerInfo)  
{  
 string callerName = Context.User.Identity.Name;  // I can obtain the caller, but how can I make use of it?  
 return Controller.GetAppointments(schedulerInfo);  

But there appears to be no way I can pass the callerName identifier in the web service to the GetAppointments(RadScheduler radScheduler) method of my provider. But my custom provider needs this information in order to retrieve the correct appointments for the given caller.

Have I missed something simple (highly likely)? Or is the provider model broken here?
Khi
Top achievements
Rank 1
 answered on 09 Feb 2011
0 answers
55 views
Just wanted to share with the forum a problem that I found and fixed with dynamic RadDocks.  I created some RadDocks in the Page_Init event and use the CurrentDockStates and RadDockLayout1_SaveDockLayout methods for the Dock.Index position to work correctly after I move a RadDock to a different position.  My code was working fine but would always error after moving a RadDock to a different position.  The problem was an UpdatePanel in the UserControl within my RadDock.  After I deleted the UpdatePanel in the UserControl, everything worked fine after a repositioning.
Richard M
Top achievements
Rank 1
 asked on 09 Feb 2011
4 answers
338 views
Hi,

I am using the RadGrid to export the data to excel. I have a button the same page. When I click the button, I set the following in the click event in the server

rgInvoice.ExportSettings.ExportOnlyData = true;
rgInvoice.ExportSettings.IgnorePaging = true;
rgInvoice.ExportSettings.OpenInNewWindow = true;
rgInvoice.MasterTableView.ExportToExcel();

I am following the example in this link
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/exporting/defaultcs.aspx
The only difference is that I am binding a datatable to the RadGrid in the .cs file.

The export works when I click the header CommandItem in the RadGrid. But when I click the button in the page, the export CommandItems header with the buttons disappear and the export doesn't work. Can anyone suggest what might be wrong.

Thanks
Prithvi
Daniel
Telerik team
 answered on 09 Feb 2011
1 answer
301 views
I have a RadEditor with a defined height whose content will need to scroll if necessary.  However, the control I've used (shown below) has no scroll bars by default.  The CSS for the page defines overflow: hidden, which could be the culprit.  However, when I've tried to specify overflow: auto (or scroll) for the editor, I get a scroll bar that encompasses the entire control (including the toolbar),  That means the toolbar scrolls as well, which is obviously not the intent.

Any help is appreciated.

<telerik:RadEditor ID="Instructions" runat="server" Width="640px" Height="300px" Skin="Office2007" EnableResize="false" EditModes="Design">

 

 

 

<Tools>

 

 

 

<telerik:EditorToolGroup >

 

 

 

<telerik:EditorTool Name="Cut" />

 

 

 

<telerik:EditorTool Name="Copy" />

 

 

 

<telerik:EditorTool Name="Paste" />

 

 

 

</telerik:EditorToolGroup>

 

 

 

</Tools>

 

 

 

</telerik:RadEditor>

 

 

 

 

Rumen Jekov
Top achievements
Rank 1
 answered on 08 Feb 2011
Narrow your results
Selected tags
Tags
+124 more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?