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

Hi all,
I am trying to add columns to my grid programmatically. It works OK with 1 column, but more than 1 throw an error about multiple controls with the same ID. I'm using the below code:

 

// Add columns programmatically
  
  
  
GridBoundColumn boundColumn;
  
int ii = 0;
  
int ij = 0;
  
foreach (DataRow row in dt.Rows)
  
{
  
// We only want to generate columns off the first row
  
  
  
if (ii>0) continue;
  
// Create the new column collection in our loop
  
  
  
boundColumn = new GridBoundColumn();
  
foreach (DataColumn col in dt.Columns)
  
{
  
// Increment to pass the first columns
  
  
  
ij++;
  
// We don't want the first column because it's our identity (ID) column
  
  
  
if (ij == 1) continue;
  
boundColumn.DataField = col.ToString();
  
boundColumn.HeaderText = col.ToString();
  
// Add the column to our grid
  
  
  
gvLUs.MasterTableView.Columns.Add(boundColumn);
  
}
  
ii++;
  
}
  
// Bind the data to the grid
  
  
  
gvLUs.DataBind();

 

 



I've checjed and the text from col.ToString() is different. The error is balking about an ID from the second column being added. The error is as the page is rendered.

Any ideas?

Thanks!
Brad
Top achievements
Rank 1
 answered on 15 Jul 2010
1 answer
232 views
Hi,

I am using Gridclientselectcoiumn in my radgrid. I have a label in my commanditemtemplate.  When user checks checkbox i just want to show number of checkboxes selected in that label. Suppose If user selects 4 checkboxes i just want to show like Selected Records: 4.  Here is my code for that......

Grid client select column....
<telerik:GridClientSelectColumn UniqueName="ClientSelectColumn"  HeaderStyle-Width="3%"  ItemStyle-Width="3%">
 <HeaderStyle Width="3%"></HeaderStyle>
 <ItemStyle Width="3%"></ItemStyle>
</telerik:GridClientSelectColumn>

commanditemtemplate

<CommandItemTemplate>
   <td align="right" style="width: 20%">
Selected Records:<asp:Label ID="lblselTsks" Width="20px" Font-Size="10pt" Font-Bold="true" runat="server" Text="0"></asp:Label>
   </td>
</CommandItemTemplate>


codebehind and JS

protected void rg200_DataBound(object sender, EventArgs e)
    {
        foreach (GridDataItem item in rg200.MasterTableView.Items)
        {
            CheckBox chkBoxOne = (CheckBox)item.FindControl("ClientSelectColumn");
            if (chkBoxOne != null)
                chkBoxOne.Attributes.Add("onclick", "javascript:return SelectOne('" + chkBoxOne.ClientID + "')");
        }
    }
 
 
JS
 
 
function SelectOne(id) {
                var count = 0;
                count = Number(document.getElementById('ctl00_PagePlaceholder_rg200_ctl00_ctl02_ctl00_lblselTsks').innerHTML);
                if (document.getElementById(id).checked == true) {
                    if (!document.getElementById(id).disabled) {
                        count = count + 1;
                    }
                }
                else if (document.getElementById(id).checked == false) {
                    if (!document.getElementById(id).disabled) {
                        count = count - 1;
                    }
                }
                document.getElementById('ctl00_PagePlaceholder_rg200_ctl00_ctl02_ctl00_lblselTsks').innerHTML = count;
            }


The problem is when i select checkbox  like 1 or more, the selected checkboxes count is not displaying. Its always showing Selected Records: 0.( See the image). Where am i doing wrong? How to resolve this issue. Any help should be appreciated.
Babu Puchakayala
Top achievements
Rank 1
 answered on 14 Jul 2010
3 answers
236 views
Hi,

I am using a RadSplitter with Orientation="Horizontal" FullScreenMode="True" LiveResize="True".
I have put 2 RadPane with 1 RadSplitBar, 1st pane locked.
In the 2nd RadPane, I have put another RadSplitter with Orientation="Vertical" FullScreenMode="True" LiveResize="True"
with 2 RadPane, 2nd pane has fixed width.

When collapsing last pane, the bottom pane of first RadSplitter shows a horizontal scrollbar.
It seams that the inner RadSplitter grows of 1px when collapsing.

Here is the code I am using :

    <form id="form1" runat="server"> 
        <ajaxToolkit:ToolkitScriptManager ID="sm" runat="server" /> 
        <telerik:RadSplitter ID="globalsplit" runat="server" Orientation="Horizontal" FullScreenMode="True" LiveResize="True"> 
            <telerik:RadPane ID="globaltoolbar" runat="server" Locked="true"> 
                <telerik:RadToolBar ID="toolbar" runat="server"> 
                    <Items> 
                        <telerik:RadToolBarButton Text="Item 1" /> 
                        <telerik:RadToolBarButton IsSeparator="true" /> 
                        <telerik:RadToolBarButton Text="Item 2" /> 
                    </Items> 
                </telerik:RadToolBar> 
            </telerik:RadPane> 
            <telerik:RadSplitBar ID="split1" runat="server" CollapseMode="None" /> 
            <telerik:RadPane ID="mainpan" runat="server"> 
                <telerik:RadSplitter ID="mainSplit" runat="server" Orientation="Vertical"  
                    FullScreenMode="True" LiveResize="True"> 
                    <telerik:RadPane ID="contentPane" runat="server"> 
                        <p>Main place</p> 
                    </telerik:RadPane> 
                    <telerik:RadSplitBar ID="mainSplitBar" runat="server" CollapseMode="Backward" /> 
                    <telerik:RadPane ID="schedulePan" runat="server" Width="260px" MinWidth="260" MaxWidth="260"> 
                            [Scheduler] 
                    </telerik:RadPane> 
                </telerik:RadSplitter> 
            </telerik:RadPane> 
        </telerik:RadSplitter> 
    </form> 
 
Daniel
Top achievements
Rank 1
 answered on 14 Jul 2010
3 answers
151 views
I have the following treeview that is loaded using LoadXML with the xml string below. The treeview has a server-side
OnNodeCheck event defined which calls "ShowCheckedNodes" (below). The problem i am having is that the event fires
but the reports.CheckNodes property does not return the checked node in the collection.

Thanks Marc

<telerik:RadTreeView ID="reports" Runat="server" BorderColor="Black"  MultipleSelect="false"  
            BorderStyle="Outset" BorderWidth="1px" Skin="Outlook" CheckBoxes="true" CheckChildNodes="false"
                     TriStateCheckBoxes="true" EnableViewState="true"
                    OnClientNodeChecked="ClientNodeClicking"
                     OnClientNodeChecking="onNodeClicked"
                    OnNodeCheck="ShowCheckedNodes"
                   style="z-index: 1; left: 15px; top: 100px; position: absolute; height: 319px; width: 245px"
                   Height="300px" SingleExpandPath="True" Width="275px"
                   ShowLineImages="False" PersistLoadOnDemandNodes="False"
                  EnableEmbeddedScripts="True" EnableAjaxSkinRendering="False">
</telerik:RadTreeView>


{<Tree>
<Node Text="Energy Reports" Value="-1">
<Node Text="Energy Monthly Summary" fm="html"  vc="uc_monthstart,uc_sites" multisite="yes"  ums="no"  Value="RS_@acctid_Benchmark"/>
<Node Text="Comparative Data" fm="excel,htm,pdf"  vc="uc_monthend,uc_sites" multisite="yes"  ums="no"  Value="RS_@acctid_CompData"/>
<Node Text="Comparative Data Input Units" fm="excel"  vc="uc_monthend,uc_sites" multisite="yes"  ums="no"  Value="RS_@acctid_CompData_Entr"/>
<Node Text="Predicted vs Actual Consumption" fm="pdf"  vc="uc_monthend,uc_sites" multisite="yes"  ums="no"  Value="RS_@acctid_PrevsAct"/>
</Node>
<Node Text="Maintenance Reports" Value="-1">
<Node Text="Preventive Maintenance" fm="pdf,html,excel"  vc="uc_monthstart,uc_sites" multisite="no"  ums="no"  Value="RS_@acctid_Pmaint"/>
<Node Text="YTD Preventive Maintenance Compliance" fm="pdf"  vc="uc_monthstart,uc_sites" multisite="no"  ums="no"  Value="RS_@acctid_PmaintYTD"/>
<Node Text="Quarterly Fire and Life Safety" vc="uc_quarter,uc_sites" multisite="no"  ums="yes"  Value="RS_@acctid_FLS"/></Node><Node Text="Budget Reports" Value="-1">
<Node Text="Basic Budget" fm="pdf"  Value="RS_@acctid_Basic"/>
<Node Text="Regression Budget" Value="RS_@acctid_Regression"/>
</Node>
<Node Text="Corporate Reports" Value="-1"><Node Text="Corporate Status Report" vc="uc_number,uc_sites" Value="RS_@AcctID_Status"/>
</Node>
</Tree>}

protected void ShowCheckedNodes(object sender, System.EventArgs e)
    {
        string message = string.Empty;
        foreach (RadTreeNode node in reports.CheckedNodes)
        {
            message += node.FullPath + "<br/>";
        }
    }
Derek Hunziker
Top achievements
Rank 1
 answered on 14 Jul 2010
4 answers
262 views
Hello,

I'm getting the following error in one of my pages:

Telerik.Web.UI.Orientation has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.

The page was working OK, but now all of a sudden, I'm getting this error.  I have this in a partial view:

<%= Html.RadControlCss<RadCalendar>() %>

<%= Html.RadControlScripts<RadCalendar>() %>

<%= Html.RadControlCss<RadDateInput>() %>

<%= Html.RadControlScripts<RadDateInput>() %>

<%= Html.RadControlCss<RadTimeView>() %>

<%= Html.RadControlScripts<RadTimeView>() %>

<%= Html.RadControlCss<RadTextBox>() %>

<%= Html.RadControlScripts<RadTextBox>() %>

<%= Html.RadControlCss<RadDatePicker>() %>

<%= Html.RadControlScripts<RadDatePicker>() %>

<%= Html.RadControlCss<RadTimePicker>() %>

<%= Html.RadControlScripts<RadTimePicker>() %>

<%= Html.RadControlScripts<RadDateTimePicker>() %>

<%= Html.RadControlCss<RadComboBox>() %>

<%= Html.RadControlScripts<RadComboBox>() %>


<%= Html.RenderRadDatePicker((rad) =>

{

rad.ID = "StartDate";

rad.SelectedDate = DateTime.Today;

 

}, "Forest") %>

<%= Html.RenderRadTimePicker((rad) =>

{

rad.ID = "StartTime";

rad.SelectedDate = DateTime.Now;

 

}, "Forest") %>

Is this the cause of anything?

Thanks.

Robert
Top achievements
Rank 1
 answered on 14 Jul 2010
2 answers
170 views
2010.1.706.35, VS2008 IE8

I have master/child table where the child table is bound by "Client" for performance reasons, so each page's client details are retrieved with the parent record.

I also have an Export button but I am only outputting the master table information.   However it's very slow (I have other exports not involving bind by Client and it's fast) so I believe the Grid is also trying to retrieve child table information during export.   There are only 1,500 rows at the parent table.  Tried exporting via CSV or Excel HTML.

1) Is there a way to prevent detail table binding in code behind when exporting?   (other than not declaratively using bind by "Client" at all)

2) When using Excel HTML export, I noticed the result has garbage information and I believe this is because one of the detail table field can store HTML comments.   What's the typical way to resolve exporting in HTML when the field value might have HTML tags?
Lenny_shp
Top achievements
Rank 2
 answered on 14 Jul 2010
4 answers
221 views

I’ve upgraded to the latest release and now I’m getting an error about "$telerik.disposeElement is not a function" when doing a post back in FF.  This worked before updating to the latest release.

Any help appreciated,
Phil

Simon
Telerik team
 answered on 14 Jul 2010
1 answer
141 views
Can someone tell me how to get rid of the Trial message that occasionally displays?  We purchased the .NET controls and downloaded them from our download page, however, I still occasionally get the message that says" Telerik.Web.UI 2010.1.415.35 trial version. Copyright telerik © 2002-2009. To remove this message, please purchase a developer version."

Any clues?
Thanks
Simon
Telerik team
 answered on 14 Jul 2010
1 answer
169 views
Hi,

I tried the export to PDF mentioned in this example -
http://www.telerik.com/community/forums/aspnet/editor/error-creating-pdf-with-radeditor.aspx

It works with simple text put out on the Editor but it did not work for me. I get the content from Database where it i stored in rtf and convert to HTML to display in editor. My Content is as shown below and this doesn't get exported to PDF.

"<html>\r\n <head>\r\n <title></title>\r\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\" />\r\n <meta name=\"Generator\" content=\"Microsoft Word 12 (filtered)\" />\r\n <style>\r\n <!--\r\n /* Font Definitions */\r\n @font-face\r\n\t{font-family:\"Cambria Math\";\r\n\tpanose-1:2 4 5 3 5 4 6 3 2 4;}\r\n@font-face\r\n\t{font-family:Calibri;\r\n\tpanose-1:2 15 5 2 2 2 4 3 2 4;}\r\n@font-face\r\n\t{font-family:Verdana;\r\n\tpanose-1:2 11 6 4 3 5 4 4 2 4;}\r\n /* Style Definitions */\r\n p.MsoNormal, li.MsoNormal, div.MsoNormal\r\n\t{margin-top:0in;\r\n\tmargin-right:0in;\r\n\tmargin-bottom:10.0pt;\r\n\tmargin-left:0in;\r\n\tline-height:115%;\r\n\tfont-size:11.0pt;\r\n\tfont-family:\"Calibri\",\"sans-serif\";}\r\np.msochpdefault, li.msochpdefault, div.msochpdefault\r\n\t{mso-style-name:msochpdefault;\r\n\tmargin-right:0in;\r\n\tmargin-left:0in;\r\n\tfont-size:11.0pt;\r\n\tfont-family:\"Times New Roman\",\"serif\";}\r\np.msopapdefault, li.msopapdefault, div.msopapdefault\r\n\t{mso-style-name:msopapdefault;\r\n\tmargin-right:0in;\r\n\tmargin-bottom:10.0pt;\r\n\tmargin-left:0in;\r\n\tline-height:115%;\r\n\tfont-size:12.0pt;\r\n\tfont-family:\"Times New Roman\",\"serif\";}\r\n.MsoChpDefault\r\n\t{font-size:10.0pt;}\r\n.MsoPapDefault\r\n\t{margin-bottom:10.0pt;\r\n\tline-height:115%;}\r\n@page WordSection1\r\n\t{size:8.5in 11.0in;\r\n\tmargin:1.0in 1.0in 1.0in 1.0in;}\r\ndiv.WordSection1\r\n\t{page:WordSection1;}\r\n-->\r\n </style>\r\n </head>\r\n <body lang=\"EN-US\" style=\"text-justify-trim: punctuation; overflow: hidden;\">\r\n <div class=\"WordSection1\">\r\n <p class=\"MsoNormal\" style=\"line-height: normal; margin-bottom: 0pt;\"><span style=\"font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: #000000; font-size: 16.5pt;\">THIS PAGE IS NO LONGER UTILIZED.this<span style=\"background: red;\"> is tested</span></span></p>\r\n </div>\r\n </body>\r\n</html>"



Please let me know what I need to do to get the ExportToPDF to work and output a proper PDF file.

thanks
SM
Rumen
Telerik team
 answered on 14 Jul 2010
2 answers
64 views
I've gotten a report that the slide show arrows aren't working, they are working for me but I did get one scenario where it worked then 5 seconds later it didn't work. Then it worked again, I think there might be some lag or undetected clicks go on here.

Can you guys try to see if it works for you, wait for the page to be done loading.
Live link: http://www.videodetective.com/

Here's the code I was going off of: http://demos.telerik.com/aspnet-ajax/rotator/examples/clientapicontrol/defaultvb.aspx

Thanks for the help!
Fiko
Telerik team
 answered on 14 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?