Hi,
I am trying to add tabs, pageviews dynamically, and then iframes in the pageviews. However, on postback, the iframes are not persisted.
HtmlGenericControl iframe = new HtmlGenericControl("iframeA");
PageView pageView = new PageView();
pageView.Controls.Add(iframe);
multiPage.PageViews.Add(pageView);
However, if i statically do it (as below), the iframes are persisted. Can you please show me a way to make this work.
Thanks,
Raj
<telerik:RadPageView id="Pageview2" runat="server" >
<iframe id="ContentIframe2" width=100% height="600px" frameborder="0" scrolling="auto" runat="server"></iframe>
</telerik:RadPageView>
<telerik:RadPageView id="Pageview3" runat="server" >
<iframe id="ContentIframe3" width=100% height="600px" frameborder="0" scrolling="auto" runat="server"></iframe>
</telerik:RadPageView>
<telerik:RadPageView id="Pageview4" runat="server" >
<iframe id="ContentIframe4" width=100% height="600px" frameborder="0" scrolling="auto" runat="server"></iframe>
</telerik:RadPageView>
<telerik:RadPageView id="Pageview5" runat="server" >
<iframe id="ContentIframe5" width=100% height="600px" frameborder="0" scrolling="auto" runat="server"></iframe>
</telerik:RadPageView>
Hi,
I need to place an "X" in all cells that have a true value in the export. I've seen similar posts, but I am using Format="Xlsx" and trying to accomplish this task using the OnInfrastructureExporting event handler as follows:
protected void grdUserAdmin_InfrastructureExporting(object sender, GridInfrastructureExportingEventArgs e)
{
var colCount = e.ExportStructure.Tables[0].Columns.Count;
var rowCount = e.ExportStructure.Tables[0].Rows.Count;
ExportStyle headerStyle = new ExportStyle();
headerStyle.ForeColor = Color.White;
headerStyle.BackColor = Color.Blue;
headerStyle.Font.Bold = true;
// Set the header style for all columns
for (var i = 1; i <= colCount; i++)
{
e.ExportStructure.Tables[0].Cells[i, 1].Style = headerStyle;
e.ExportStructure.Tables[0].Columns[i].Width = 200; // Would like auto-width !!
}
// Place an "X" in cells assigned to a boolean data field if value is true
var headerText = "";
for (var c = 1; c <= colCount; c++)
{
for (var r = 1; r <= rowCount; r++)
{
if (r == 1)
{
headerText = e.ExportStructure.Tables[0].Cells[c, r].Value.ToString();
continue;
}
if (headerText == "Active")
{
var x = e.ExportStructure.Tables[0].Cells[c, r].Value.ToString();
System.Diagnostics.Debug.WriteLine("Cell Value: " + x);
if (Convert.ToBoolean(e.ExportStructure.Tables[0].Cells[c, r].Value.ToString()))
e.ExportStructure.Tables[0].Cells[c, r].Value = "X";
}
}
}
}
The value for the variable x above is always "" or null (hard to tell in the Output section of VS).
I know that my data for column Active should have all true values.
The conversion to boolean fails!
I think I'm close.
What am I doing wrong?
Thanks in advance for any advice.
Jim
<
telerik:RadGrid
ID
=
"rgComments"
runat
=
"server"
AutoGenerateColumns
=
"False"
Width
=
"100%"
AllowSorting
=
"True"
CellSpacing
=
"0"
GridLines
=
"None"
Height
=
"455px"
>
<
MasterTableView
CommandItemDisplay
=
"Top"
CommandItemSettings-AddNewRecordText
=
"Add Comment"
CommandItemSettings-ShowRefreshButton
=
"true"
TableLayout
=
"Fixed"
EditMode
=
"EditForms"
DataKeyNames
=
"iNoteID,qwImageID"
>
<
EditFormSettings
EditFormType
=
"Template"
>
<
FormTemplate
>
<
div
style
=
"position: relative; height: 215px; width: 800px;"
>
<
telerik:RadTextBox
ID
=
"rtbComment"
runat
=
"server"
Width
=
"795px"
Height
=
"165px"
ClientEvents-OnLoad
=
"taComment_onload"
/>
<
asp:ImageButton
ID
=
"ibSave"
runat
=
"server"
ImageUrl
=
"~/Images/Save.png"
CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' style="position: absolute; left: 10px; top: 180px;" />
<
asp:ImageButton
ID
=
"ibCancel"
runat
=
"server"
ImageUrl
=
"~/Images/Cancel.png"
CommandName
=
"Cancel"
style
=
"position: absolute; left: 70px; top: 180px;"
/>
</
div
>
</
FormTemplate
>
</
EditFormSettings
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
HeaderStyle-Width
=
"30px"
ItemStyle-HorizontalAlign
=
"Center"
EditImageUrl
=
"~/Images/Edit.png"
UniqueName
=
"gecEdit"
/>
<
telerik:GridBoundColumn
DataField
=
"dtCreateDate"
HeaderText
=
"Create Date"
HeaderStyle-Width
=
"66"
HeaderStyle-HorizontalAlign
=
"Center"
DataFormatString
=
"{0:MM/dd/yyyy HH:mm}"
ReadOnly
=
"True"
UniqueName
=
"gbc_dtCreateDate"
/>
<
telerik:GridBoundColumn
DataField
=
"cLoginName"
HeaderText
=
"Create By"
HeaderStyle-Width
=
"66"
HeaderStyle-HorizontalAlign
=
"Center"
ItemStyle-HorizontalAlign
=
"Center"
ReadOnly
=
"True"
UniqueName
=
"gbc_cLoginName"
/>
<
telerik:GridBoundColumn
DataField
=
"cNote"
HeaderText
=
"Comment"
HeaderStyle-HorizontalAlign
=
"Center"
ItemStyle-HorizontalAlign
=
"Left"
HeaderStyle-Width
=
"500px"
MaxLength
=
"1024"
UniqueName
=
"gbc_cNote"
/>
<
telerik:GridButtonColumn
ButtonType
=
"ImageButton"
CommandName
=
"Delete"
HeaderStyle-Width
=
"30px"
ItemStyle-HorizontalAlign
=
"Center"
ImageUrl
=
"~/Images/Delete.png"
UniqueName
=
"bcDelete"
/>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
><
Scrolling
AllowScroll
=
"true"
/></
ClientSettings
>
</
telerik:RadGrid
>
void
rgComments_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item.IsInEditMode && e.Item
is
GridEditableItem)
{
GridEditableItem item = e.Item
as
GridEditableItem;
RadTextBox radTextBox = ((RadTextBox)(((GridEditFormItem)(item)).FindControl(
"rtbComment"
)));
// It works if I comment out this line, but then control is not populated with the necessary text
radTextBox.Text = ((DataRowView)(((GridItem)(item)).DataItem)).Row[
"cNote"
].ToString();
radTextBox.Focus();
}
}
Dear Friends,
I am preparing dynamic grid using VB.net and RAD grid where columns are getting generated in Run Time. I am trying to apply filter (inbuilt filter) on multiple column at time but application is throwing exception (is neither a DataColumn nor a DataRelation for table Table). This error occurs when I try to apply filter. I am unable to identify root cause. Any input would be appreciated. I am using NeedDataSource() event of Radgrid and this event is throwing above mentioned exception on applying filter.
Thanks in advance.
Lokesh
I know I have done this before, but I can't remember how....don't you hate being in that situation?!?
I want a simple nested table, of say customers and their orders, displayed in a fashion where customers are the master table, and orders are the detail table. In other words, the grid shows a list of customers and you can expand a customer to see their orders. I can easily get the data in a datatable where the customer data is duplicated on each row which represents a unique order. I want to setup the grid so that I can do one bind and have it all populated. All of the examples now show a separate databind for each of the child(nested) tables. For efficiency and simplicity, I'd like to avoid all of the extra databinds. I know I've done this in the past...
Any help or examples would be greatly appreciated.
Thanks in advance,
I am facing the issue with batchedit when I am trying to get the dropdown list from the grid edit row and append its list with new item. All this am trying to do in a client function "Batcheditopening". I have a rad grid with batch edit mode . In editor template I have a dropdown list which I am binding with database at grid pretender event. I have a requirement where I have to append a new item in the dropdown based on the value of template cell.
Please help me to solve this scenario.
I have a chart that has an additional Y Axis which should be on the far right of the chart.
If the chart and series is set as a "Line" I can set the AxisCrossingPoint value for the second Axis and it shows it correctly but if I have the chart type set as "ScatterLine" (which I require) it does not move the Axis and just stays on the left of the chart next to the first Y Axis.
No matter what value I under it does not move at all. I've tried it in code behind and in the HTML. Very strange as it works fine for "Line" type series/chart.
Is this a limitation of ScatterLine?
I have a situation where the data coming in because of the data coming from two separate tables can have the same ID. The ID is mapped to the NodeID (DataFieldID) of the tree view. Because of this I can have two nodes with the same id. Instead of changing my data model converting the ID (int) to a ID (GUID) I would like to see if there is a mechanism in the TreeView where I can check to see if when adding a node check to see if the parent node is accepting a child or not. The below structure represents my tree structure.
When tree evaluates Node 75 with ParentID 37, I want it at the bottom node as it’s a folder vs the first 37 as it not a node that can have children.
NodeID 75
ParentID 37
NodeID 18
ParentID null
NodeID 69
ParentID 18
NodeID 56
ParentID 18
NodeID 37 ß I don’t want it here
Parent 18
NodeID 1
Parent 18
NodeID 12
Parent 18
NodeID 26
Parent 18
NodeID 37 ß I want it here
ParentID 18
Is there an event I can write code for to interrogate the node to see if I can add a child?