Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
389 views

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> 

Patrick
Top achievements
Rank 1
 answered on 15 Jun 2016
9 answers
455 views

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

jlj30
Top achievements
Rank 2
 answered on 14 Jun 2016
11 answers
798 views
I have a RadGrid that uses an EditForm template in order to lay the controls out according to the wishes of the customer. I have not been able to get the RadTextBox within the template to receive focus when it goes into edit mode.
<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>

When the form goes into edit mode I want to put the current Comment text into the RadTextBox and set focus there. I am using this code to try and do that.
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();
  }
}

I have tried adding a client-side onload event handler for the control to set the focus. It gets called but still won't put focus into the control.

Can you help me figure this out?

John
jlj30
Top achievements
Rank 2
 answered on 14 Jun 2016
7 answers
449 views
Is there a way to get the headertext to be visible in the header of a GridClientSelectColumn?
I have a customer who insists that "nobody is going to know what it does" if there isn't any text in the header...
Eyup
Telerik team
 answered on 14 Jun 2016
1 answer
140 views
I had setup a way to restore the filtering/sorting of the grid through session on page load when it went to "NeedDataSource" function. However, the data I am currently populating has a lot of data, and had to optimize the performance of the grid by starting to use the entitydatasource that you specified in the documentation. The grid is faster, but I am unsure how to restore the filter/sort settings the user made now. Is there another way I can restore?
Viktor Tachev
Telerik team
 answered on 14 Jun 2016
1 answer
199 views

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

Viktor Tachev
Telerik team
 answered on 14 Jun 2016
1 answer
135 views

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,

Pavlina
Telerik team
 answered on 14 Jun 2016
1 answer
90 views

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.

 

Pavlina
Telerik team
 answered on 14 Jun 2016
1 answer
107 views

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?

Slav
Telerik team
 answered on 14 Jun 2016
1 answer
101 views

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?

Ivan Danchev
Telerik team
 answered on 14 Jun 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?