Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
225 views

I am following this example to implement a grid.

http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/autogeneratedhierarchy/defaultcs.aspx 

My radgrid markup is below:

<telerik:RadGrid ID="RadGrid1" runat="server" Height="412px" Width="818px" AutoGenerateColumns="true"
    AllowSorting="true" GroupingSettings-CaseSensitive="false" ClientSettings-Scrolling-AllowScroll="true"
    AutoGenerateHierarchy="true" PageSize="20" Skin="WebBlue" PagerStyle-AlwaysVisible="true"
    ClientSettings-ClientEvents-OnRowDblClick="RowDblClick" ClientSettings-Resizing-AllowColumnResize="true"
    ClientSettings-Scrolling-UseStaticHeaders="false" ClientSettings-Selecting-AllowRowSelect="true"
    ClientSettings-ClientEvents-OnRowClick="RadGrid1_RowSelected" ClientSettings-Scrolling-SaveScrollPosition="true"
    AllowFilteringByColumn="true" AllowPaging="true" OnNeedDataSource="RadGrid1_NeedDataSource"
    OnDetailTableDataBind="RadGrid1_DetailTableDataBind" OnColumnCreated="RadGrid1_ColumnCreated"
    OnPreRender="RadGrid1_PreRender" OnItemDataBound="RadGrid1_ItemDataBound"
    OnItemCreated="RadGrid1_ItemCreated" ondatabound="RadGrid1_DataBound">
    <MasterTableView AllowMultiColumnSorting="True" ClientDataKeyNames="rvlPropertyID"
        DataKeyNames="rvlPropertyID" HierarchyLoadMode="Client" Name="Property" Width="100%">
    </MasterTableView>
    <HeaderStyle VerticalAlign="Top" Width="125px" />
    <PagerStyle AlwaysVisible="True" />
</telerik:RadGrid>


I have a drop down that changes the child level of the grid, where it be Assessment or Access. The problem I am running in to is that I allow the user to double click on a row in the child level, and then I will grab the dataKeyValue and launch an editor. I've tried putting these lines in the PreRender event, but it did not work.

switch (m_GridViewType)
{
    case "Access":
        RadGrid1.MasterTableView.DetailTables[0].Name = "Access";
        RadGrid1.MasterTableView.DetailTables[0].DataKeyNames = new string[] { "rvlPropertyID", "rvlPropertyAccessID" };
        RadGrid1.MasterTableView.DetailTables[0].ClientDataKeyNames = new string[] { "rvlPropertyID", "rvlPropertyAccessID" };
        break;
    case "Assessment":
        RadGrid1.MasterTableView.DetailTables[0].Name = "Assessment";
        RadGrid1.MasterTableView.DetailTables[0].DataKeyNames = new string[] { "rvlPropertyID", "rvlPropAssessmentID" };
        RadGrid1.MasterTableView.DetailTables[0].ClientDataKeyNames = new string[] { "rvlPropertyID", "rvlPropAssessmentID" };
        break;
    case "Status":
        RadGrid1.MasterTableView.DetailTables[0].Name = "Status";
        RadGrid1.MasterTableView.DetailTables[0].DataKeyNames = new string[] { "rvlPropertyID", "rvlPropertyStatusID" };
        RadGrid1.MasterTableView.DetailTables[0].ClientDataKeyNames = new string[] { "rvlPropertyID", "rvlPropertyStatusID" };
        break;
    case "Contact":
        RadGrid1.MasterTableView.DetailTables[0].Name = "Contact";
        RadGrid1.MasterTableView.DetailTables[0].DataKeyNames = new string[] { "rvlPropertyID", "cntContactID" };
        RadGrid1.MasterTableView.DetailTables[0].ClientDataKeyNames = new string[] { "rvlPropertyID", "cntContactID" };
        break;
    case "Call":
        RadGrid1.MasterTableView.DetailTables[0].Name = "Call";
        RadGrid1.MasterTableView.DetailTables[0].DataKeyNames = new string[] { "rvlPropertyID", "clnCallinLogID" };
        RadGrid1.MasterTableView.DetailTables[0].ClientDataKeyNames = new string[] { "rvlPropertyID", "clnCallinLogID" };
        break;
}


But the javascript method never pulls the datakeyValue because it does not have the datakeynames

function RowDblClick(sender, eventArgs) {
          var propid = eventArgs.getDataKeyValue("rvlPropertyID");
          switch (document.getElementById('<%=cmbGridViews.ClientID %>').value) {
              case "Access":
                  var childID = eventArgs.getDataKeyValue("RvlPropertyAccessID");
                  break;
              case "Assessment":
                  var childID = eventArgs.getDataKeyValue("RvlPropAssessmentID");
                  break;
              case "Status":
                  var childID = eventArgs.getDataKeyValue("RvlPropertyStatusID");
                  break;
              case "Contact":
                  var childID = eventArgs.getDataKeyValue("CntContactID");
                  break;
              case "Call":
                  var childID = eventArgs.getDataKeyValue("ClnCallinLogID");
                  break;
              default:
                  break;
          }
 
          var targetCell = eventArgs.get_domEvent().target;
 
          if (childID == undefined) {
              if (targetCell.cellIndex == 1) // Property Name
                  window.radopen("Editors/PropertyEditor.aspx?propid=" + propid, "editWindow");
              else if (targetCell.cellIndex == 7 && targetCell.innerHTML != "0") // photocounter and does not = 0
                  window.radopen(GetPhotoViewerURL() + "PhotoViewer.aspx?id=" + propid, "PhotoWindow");
          }
          else { // is child row
              if (targetCell.cellIndex == 0) // Assessment date
                  window.radopen("Editors/PropertyAssessmentEditor.aspx?id=" + rvlAssessmentID, "editWindow");
              else if (targetCell.cellIndex == 11 && targetCell.innerHTML != "0")
                  window.radopen(GetPhotoViewerURL() + "PhotoViewer.aspx?id=" + rvlAssessmentID, "PhotoWindow");
          }
      }
Tsvetoslav
Telerik team
 answered on 28 Feb 2012
3 answers
270 views
Hello,
i have aspx page(web application using c#) having asp panel and under this panel i have radgrid, now i want to resize my panel or radgrid as per client screen resolution so that it can fit to screen( doesnot leave blank space). My current screen resolution is 1024*768 and its working fine but as soon i reset it to 1280*960 panel with grid, shifted  above and leave blank space on the bottom of page.
aspx code #

 

 

<asp:Panel ID="pnlDetailGrid" runat="server" Visible="false" CssClass="myPanelClass">

 

 

 

<asp:ImageButton ID="ImageButton1" runat="server" AlternateText="Export to Excel"

 

 

 

CssClass="imButton" ImageUrl="~/Images/Excel.jpg" OnClick="ImageButton1_Click" />

 

 

 

<telerik:RadGrid ID="RadGrid1" runat="server" Width="100%"

 

 

 

AutoGenerateColumns="False" AllowMultiRowSelection="False" AllowPaging="true" PageSize="15"

 

 

 

OnDetailTableDataBind="RadGrid1_DetailTableDataBind" Skin="Black" AllowCustomPaging="true"

 

 

 

onneeddatasource="RadGrid1_NeedDataSource"

 

 

 

onitemcreated="RadGrid1_ItemCreated" onitemcommand="RadGrid1_ItemCommand"

 

 

 

onexcelexportcellformatting="RadGrid1_ExcelExportCellFormatting"

 

 

 

onexcelmlexportrowcreated="RadGrid1_ExcelMLExportRowCreated"

 

 

 

onexcelmlexportstylescreated="RadGrid1_ExcelMLExportStylesCreated">

 

 

 

 

<PagerStyle Mode="NumericPages" />

 

 

 

 

<MasterTableView TableLayout="Fixed" AllowMultiColumnSorting="True" cellpadding="0" DataKeyNames="TXNORDER" Width="100%" CommandItemDisplay="Top" GroupLoadMode="Server">

 

 

 

<CommandItemTemplate>

 

 

 

<asp:CheckBox ID="CheckBox2" AutoPostBack="true" CssClass="CheckBox" runat="server" ForeColor="White" Text="Show Filter" />

 

 

 

</CommandItemTemplate>

 

 

 

 

<DetailTables>

 

 

 

<telerik:GridTableView DataKeyNames="TXNORDER" Name="Orders" Width="100%">

 

 

 

<Columns>

 

 

 

<telerik:GridTemplateColumn HeaderStyle-Width="5px">

 

 

 

<ItemTemplate>

 

 

 

<asp:ImageButton ID="imgCheck" runat="server" CausesValidation="false"

 

 

 

CommandArgument='<%# DataBinder.Eval(Container.DataItem, "CaptureImageKey")%>'

 

 

 

CommandName='<%# DataBinder.Eval(Container.DataItem, "ItemTypePK")%>'

 

 

 

Height="20px" ImageUrl="~/Images/check-template.png" onclick="imgCheck_Click"

 

 

 

ToolTip="Check Image" Width="30px"/>

 

 

 

</ItemTemplate>

 

 

 

<HeaderStyle Width="40px" />

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridBoundColumn DataField="TXNORDER" HeaderButtonType="TextButton"

 

 

 

HeaderText="Transaction#" SortExpression="TXNORDER"

 

 

 

UniqueName="TXNORDER" Visible="False">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="ItemTypePK" HeaderButtonType="TextButton"

 

 

 

HeaderText="Type" SortExpression="ItemTypePK" UniqueName="ItemTypePK">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="FIELD7" HeaderButtonType="TextButton"

 

 

 

HeaderText="Serial#" SortExpression="FIELD7" UniqueName="FIELD7">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="FIELD6" HeaderButtonType="TextButton"

 

 

 

HeaderText="P44" SortExpression="FIELD6" UniqueName="FIELD6">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="FIELD5" HeaderButtonType="TextButton"

 

 

 

HeaderText="Routing#" SortExpression="FIELD5" UniqueName="FIELD5">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="FIELD4" HeaderButtonType="TextButton"

 

 

 

HeaderText="AltSerial#" SortExpression="FIELD4" UniqueName="FIELD4">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="FIELD3" HeaderButtonType="TextButton"

 

 

 

HeaderText="Account#" SortExpression="FIELD3" UniqueName="FIELD3">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="FIELD2" HeaderButtonType="TextButton"

 

 

 

HeaderText="TC#" SortExpression="FIELD2" UniqueName="FIELD2">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Amount" HeaderButtonType="TextButton"

 

 

 

HeaderText="Amount" SortExpression="Amount" UniqueName="Amount"

 

 

 

HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">

 

 

 

<HeaderStyle HorizontalAlign="Center" />

 

 

 

<ItemStyle CssClass="pad" HorizontalAlign="Right" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="CaptureImageKey" HeaderButtonType="TextButton"

 

 

 

HeaderText="CaptureImageKey" SortExpression="CaptureImageKey"

 

 

 

UniqueName="CaptureImageKey" Visible="false">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="EnterpriseID" HeaderButtonType="TextButton"

 

 

 

HeaderText="EnterpriseID" SortExpression="EnterpriseID"

 

 

 

UniqueName="EnterpriseID" Visible="false">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="ReverseReason" HeaderButtonType="TextButton"

 

 

 

HeaderText="ReverseReason" SortExpression="ReverseReason"

 

 

 

UniqueName="ReverseReason" Visible="false">

 

 

 

</telerik:GridBoundColumn>

 

 

 

</Columns>

 

 

 

</telerik:GridTableView>

 

 

 

</DetailTables>

 

 

 

<Columns>

 

 

 

 

<telerik:GridTemplateColumn HeaderStyle-Width="5px">

 

 

 

<ItemTemplate>

 

 

 

<asp:ImageButton ID="imgReverseTransaction" runat="server"

 

 

 

CausesValidation="false" Height="20px" Width="20px"

 

 

 

CommandArgument='<%#Eval("TXNORDER") + ","+Eval("EnterpriseID")+ ","+Eval("BankID")+ ","+Eval("BranchID")+ ","+Eval("BatchID")+ ","+Eval("OPENEDTIME") + ","+Eval("SourceTypePK")+ ","+Eval("AuxBatchID")%>'

 

 

 

CommandName="ReverseTransaction"

 

 

 

ImageUrl="~/Images/green-undo-icon.png" onclick="imgReverseTransaction_Click"

 

 

 

OnClientClick="javascript:return confirm('Are you sure? \n This action cannot be undone.')"

 

 

 

ToolTip="Reverse Transaction"

 

 

 

visible='<%#DataBinder.Eval(Container.DataItem,"ShowImgReverseTransaction")%>'/>

 

 

 

</ItemTemplate>

 

 

 

<HeaderStyle Width="30px" />

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridBoundColumn DataField="TXNORDER" HeaderButtonType="TextButton"

 

 

 

HeaderText="Transaction #" SortExpression="TXNORDER"

 

 

 

UniqueName="TXNORDER">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="CaptureStatus" HeaderButtonType="TextButton"

 

 

 

HeaderText="Capture Status" SortExpression="CaptureStatus">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="TRANSACTIONTIME" HeaderButtonType="TextButton"

 

 

 

HeaderText="Transaction Time" SortExpression="TRANSACTIONTIME">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Amount" HeaderButtonType="TextButton"

 

 

 

HeaderText="Amount" SortExpression="Amount" UniqueName="Amount"

 

 

 

HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">

 

 

 

<HeaderStyle HorizontalAlign="Center" />

 

 

 

<ItemStyle CssClass="pad" HorizontalAlign="Center" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

<ClientSettings>

 

 

 

<Scrolling AllowScroll="True" EnableVirtualScrollPaging="True" UseStaticHeaders="True"

 

 

 

SaveScrollPosition="True"></Scrolling>

 

 

 

</ClientSettings>

 

 

 

</telerik:RadGrid>

 

 

 

 

</asp:Panel>

 

Pavlina
Telerik team
 answered on 28 Feb 2012
4 answers
113 views
Hello
I am using the following grid: http://demos.telerik.com/aspnet-ajax/grid/examples/groupby/headerandfootertemplates/defaultcs.aspx .
Could you please tell me if the group header message ((Showing 1 of 2 items. Group continues on the next page.)) can be customized by my preferences?
Thank you
adi
Top achievements
Rank 1
 answered on 28 Feb 2012
2 answers
436 views
I've been trying to find a way to access the DataKey values for a detail table item in the ItemCreated event.  I need to be able to set the NavigateURL control to a javascript function using the DataKey values, but I'm having a hard time finding the correct syntax to access the items.  Is this possible?  Where should I be performing this action so I can set my NavigateURLs correctly?
Matt DiPietro
Top achievements
Rank 1
 answered on 28 Feb 2012
4 answers
156 views
Hi,

I have 2 RadNumericTextBox. One contains the weight in Kg and the other in Lbs. I have the event "onkeyup" on each controls that update the right RadNumericTextBox with the correct value. Example: if I write 100kg it will update the Lbs to 220.

My problem is that I use SpinButtons, so the "onkeyup" event is not raised. Can I add an "onclick" event on SpinButtons then I can call my "onkeyup" event?
Jocelyn
Top achievements
Rank 1
 answered on 28 Feb 2012
1 answer
72 views
Hello,
I was wondering if it's possible to pass in a custom string to get_html() in order to run the filters on what I pass in. Our project works with individual paragraphs (instead of entire content) so I'd like to push their html through the filters either by string or element reference. Preferably run all the enabled filters at the same time, or if that's not possible, call the getHtmlContent method on each filter.

Thanks
Rumen
Telerik team
 answered on 28 Feb 2012
1 answer
59 views
Hello!

When using IE9 and setting the enabled property of a NumericTextBox to false, a vertical scrollbar appears on the screen.

Setting the enabled property on a DatePicker also causes rendering problems.

Regards,
Günter
Galin
Telerik team
 answered on 28 Feb 2012
2 answers
134 views
HI,
I have installed a trial version of Sharepoint accelerator kit.
It was quite simple to configure spradgrid to sql server.
I have noticed that the filter doesnt work for arabic data. Is there any way for passing unicode characters?
Even the filter is case sensitive for English words.
How can we rename the column names as I have to rename the columns to arabic. My field names in the table are in English.
How can we proceed to purchase the software?

Hope to have an early feedback.
Tsvetoslav
Telerik team
 answered on 28 Feb 2012
1 answer
60 views
Hi,

Am using a rad Editor with the below design , style & properties .
It works fine on IE but its design changes in mozilla firefox (all version)when traversed from Design/Preview to Html mode.Let  me know
what should be done ?

EditorContentArea.css

body
{
    font-family: verdana !important;
    color: black !important;
    background-color: White !important;
    font-size: 9pt !important;
}
DynamicContentEditorToolsFile.xml
<root>
    <tools dockable="false">
        <tool name="FindAndReplace"/>
        <tool name="AjaxSpellCheck"/>
        <tool separator="true"/>
        <tool name="Cut"/>
        <tool name="Copy"/>
        <tool name="Paste"/>
        <tool name="PasteFromWord"/>
        <tool name="PastePlainText"/>
        <tool separator="true"/>
        <tool name="Undo"/>
        <tool name="Redo"/>

        <tool separator="true"/>

        <tool name="InsertSymbol"/>

    </tools>
    <tools dockable="false">
        <tool name="Bold"/>
        <tool name="Italic"/>
        <tool name="Underline"/>
        <tool separator="true"/>
        <tool name="JustifyLeft"/>
        <tool name="JustifyCenter"/>
        <tool name="JustifyRight"/>
        <tool name="JustifyFull"/>
        <tool separator="true"/>
        <tool name="InsertOrderedList"/>
        <tool name="InsertUnorderedList"/>
        <tool name="Outdent"/>
        <tool name="Indent"/>
        <tool separator="true"/>

        <tool name="StrikeThrough"/>

        <tool name="InsertParagraph"/>
        <tool name="Help"/>
    </tools>
    <tools dockable="false">
        <tool name="FontName"/>
        <tool name="FontSize"/>
        <tool name="ForeColor"/>
        <tool name="BackColor"/>

        <tool name="FormatStripper"/>
        <tool name="LinkManager" />
    </tools>

    <tools dockable="false">
        <tool name="InsertTable" />
        <tool name="InsertRowAbove" />
        <tool name="InsertRowBelow" />
        <tool name="DeleteRow" />
        <tool name="InsertColumnLeft" />
        <tool name="InsertColumnRight" />
        <tool name="DeleteColumn" />
    </tools>
</root>

 <telerik:RadEditor id="txtDescription" runat="server" toolbarmode="ShowOnFocus" skin="Office2007"
        enableresize="false" enabletextareamode="false" width="90%" height="100px" clientidmode="Static"
        allowscripts="false" contentfilters="EncodeScripts" ContentAreaCssFile="~/Styles/EditorContentArea.css" ToolsFile="DynamicContentEditorToolsFile.xml">
    </telerik:RadEditor>

Rumen
Telerik team
 answered on 28 Feb 2012
2 answers
227 views
Hi,

Am using a rad Editor with the below design , style & properties .
It works fine on IE but its design changes in mozilla firefox (all version)when traversed from Design/Preview to Html mode.Let  me know
what should be done ?

EditorContentArea.css

body
{
    font-family: verdana !important;
    color: black !important;
    background-color: White !important;
    font-size: 9pt !important;
}
DynamicContentEditorToolsFile.xml
<root>
    <tools dockable="false">
        <tool name="FindAndReplace"/>
        <tool name="AjaxSpellCheck"/>
        <tool separator="true"/>
        <tool name="Cut"/>
        <tool name="Copy"/>
        <tool name="Paste"/>
        <tool name="PasteFromWord"/>
        <tool name="PastePlainText"/>
        <tool separator="true"/>
        <tool name="Undo"/>
        <tool name="Redo"/>

        <tool separator="true"/>

        <tool name="InsertSymbol"/>

    </tools>
    <tools dockable="false">
        <tool name="Bold"/>
        <tool name="Italic"/>
        <tool name="Underline"/>
        <tool separator="true"/>
        <tool name="JustifyLeft"/>
        <tool name="JustifyCenter"/>
        <tool name="JustifyRight"/>
        <tool name="JustifyFull"/>
        <tool separator="true"/>
        <tool name="InsertOrderedList"/>
        <tool name="InsertUnorderedList"/>
        <tool name="Outdent"/>
        <tool name="Indent"/>
        <tool separator="true"/>

        <tool name="StrikeThrough"/>

        <tool name="InsertParagraph"/>
        <tool name="Help"/>
    </tools>
    <tools dockable="false">
        <tool name="FontName"/>
        <tool name="FontSize"/>
        <tool name="ForeColor"/>
        <tool name="BackColor"/>

        <tool name="FormatStripper"/>
        <tool name="LinkManager" />
    </tools>

    <tools dockable="false">
        <tool name="InsertTable" />
        <tool name="InsertRowAbove" />
        <tool name="InsertRowBelow" />
        <tool name="DeleteRow" />
        <tool name="InsertColumnLeft" />
        <tool name="InsertColumnRight" />
        <tool name="DeleteColumn" />
    </tools>
</root>

 <telerik:RadEditor id="txtDescription" runat="server" toolbarmode="ShowOnFocus" skin="Office2007"
        enableresize="false" enabletextareamode="false" width="90%" height="100px" clientidmode="Static"
        allowscripts="false" contentfilters="EncodeScripts" ContentAreaCssFile="~/Styles/EditorContentArea.css" ToolsFile="DynamicContentEditorToolsFile.xml">
    </telerik:RadEditor>


Rumen
Telerik team
 answered on 28 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?