Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
147 views
Hello,

I need to be able to add dynamically created textboxes to my Grid rows. I'm doing that in the grid's ItemCreated event. However, on post back my text boxes are being recreated and therefore losing their values. I don't want to have to recreat my textbox controls in Page_Init. I had an idea to read the textbox values on the client side and write them to a hidden field control. The problems is that I can't figure out how to access the SelectedRow's controls collection to find my text boxes.
Also, the number of text boxes per row is also dynamic. Meaning Row 1 may have just 1 textbox while Row 2 has 3. This is why  i need to be able to dynamically loop the row's controls since I won't know exactly how many text boxes were created for a given row
Here is what I'm trying to do

 

function RowSelected(row)

 

{

 

 

    for (i=0;i<row.Controls.count;i++)

 

    {

 

        if (row.Controls[i].type == "text")//if the type of control is textbox

 

        {

            alert(row.Controls[i].id);

        }

    }

 

 

 

}

I'm getting a javascript error that controls.count is null

How can  I accomplish this task? It's doesn't have to be the same solution as outlined above. I just need to be able to create those text boxes at run time and access their values on the server at postback.

Thanks in advance ;)

Iana Tsolova
Telerik team
 answered on 16 Apr 2009
1 answer
90 views
When I select the template manager and import a previously created template the HTML is stripped and all I get is text in the editors content area. What/where or how do I set the editor to not strippout the HTML

Thanks in Advance All,

Craig T
Rumen
Telerik team
 answered on 16 Apr 2009
2 answers
81 views
Hi,

I'm wondering if there is a way to specify what text I want for the "NextPages" / "PreviousPages" in the RadGrid PAger Control. I see there is a property for NextPagesToolTip but there is not one for NextPagesText. I would like to display "Next Pages" instead of "...".

1 2 3 4 5 6 7 8 9 10 ... I want to be 1 2 3 4 5 6 7 8 9 10 Next Pages

Thanks

<PagerStyle Mode="NumericPages" Position="TopAndBottom" CssClass="ListingsPageing" PrevPageImageUrl="/images/prev.jpg" NextPageImageUrl="/images/next.jpg"></PagerStyle>
Matt
Top achievements
Rank 1
 answered on 16 Apr 2009
1 answer
113 views
hi,

i need to increase the height of the grid dynamicaly based on the screen resolution. Is it possible?

if so i need the code to accomplish the above task.

Any help would be greatly appreciated.

Thanks,

Prakash.
Shinu
Top achievements
Rank 2
 answered on 16 Apr 2009
1 answer
118 views
Hi

  I am using the RAD Window Manager to display the alert messages and confirm messages.
  The Current version uses Template regions to display alert, confirm and prompt messages.

  I need to add customized Buttons instead of the normal yes and no Button.
  I have tried to create my own style sheet for the Customized Buttons  but looks like the CSS is not working  when i try to create an user control for the Confirm Template.and apply the CSS to the Button.
Below is the code snippet which i am using to create an ConfirmTemplate userControl

<link href="../../../App_Themes/CSS/Sample.css" rel="Stylesheet" type="text/css" />

<div class="rwDialogPopup radconfirm">   
<div class="rwDialogText">
{
1}    
</div>      
<div>
<a onclick="$find('{0}').close(true);"   href="javascript:void(0);" ><div class="button1"></div></a>
 
<a onclick="$find('{0}').close(false);"  href="javascript:void(0);"><div class="button2"></div></a>
</div>
</
div>

  Can you please suggest me some ways to achieve it.

Regards
Bose Thirumalai
Georgi Tunev
Telerik team
 answered on 16 Apr 2009
14 answers
374 views
I have a RadGrid which has export buttons above it that I use to export to excel, word, and pdf.  They work fine on all of my other pages.  However, we are experiencing a major issue when I have some code behind writing to a tooltip.

ToolTip components from RadControls
<telerik:GridTemplateColumn HeaderText="Actions" HeaderStyle-Width="50" ItemStyle-HorizontalAlign="center">     
   <ItemTemplate>    
     <telerik:RadToolTip ID="RadToolTipMessage" TargetControlID="LabelRefreshStatus" RelativeTo="Element" Position="BottomLeft" runat="server" />   
     <telerik:RadToolTip ID="RadToolTipImage" TargetControlID="ImageErrorMessage" RelativeTo="Element" Position="BottomLeft" ManualClose="true" runat="server" />   
     <asp:ImageButton ID="ImageButtonDetails" ImageUrl="~/images/office/txt.gif" AlternateText="See Details" runat="server" />    
     <asp:Label ID="LabelRefreshStatus" runat="server" />   
     <telerik:RadToolTip ID="RadToolTipDetails" TargetControlID="ImageButtonDetails" Position="TopLeft" Sticky="true" runat="server" />   
   </ItemTemplate>    
</telerik:GridTemplateColumn>     

Code Behind for ToolTip
refreshStatus.Text = EMAUtilities.BatchStatus(Convert.ToInt32(dataItem["STATUS_ID"].Text));     
RadToolTip message = ((RadToolTip)e.Item.Cells[0].FindControl("RadToolTipMessage"));     
RadToolTip imageMessage = ((RadToolTip)e.Item.Cells[0].FindControl("RadToolTipImage"));     
RadToolTip detail = ((RadToolTip)e.Item.Cells[0].FindControl("RadToolTipDetails"));     
Label refreshStatus = (Label)e.Item.Cells[0].FindControl("LabelRefreshStatus");   
System.Web.UI.WebControls.  
Image imageResults = (System.Web.UI.WebControls.Image)e.Item.Cells[0].FindControl("ImageErrorMessage");  

ERROR OCCURS HERE, ALL OF THE LINES ERROR OUT with the message below.
message.Text = "Good Job!";  
imageMessage.Text = "You have done a good job!";  
imageResults.Visible = true;  
refreshStatus.CssClass = "colorGreen";  
imageResults.ImageUrl = "~/images/Good.gif";  
imageResults.Visible = true


ERROR MESSAGE!!
System.NullReferenceException was unhandled by user code
  Message="Object reference not set to an instance of an object."
  Source="App_Web_kktldl24"
  StackTrace:
       at RefreshStatus.RadGrid1_ItemDataBound(Object sender, GridItemEventArgs e) in c:\TFS\MEC.EMA\Development\Source\EMA.Internal\pricing\refresh\RefreshStatus.aspx.cs:line 191
       at Telerik.Web.UI.RadGrid.OnItemDataBound(GridItemEventArgs e)
       at Telerik.Web.UI.GridItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows)
       at Telerik.Web.UI.GridItemBuilder.InitializeItem(Int32 dataSourceIndex, String& nextItemHierarchicalIndex, Boolean& itemIsInEditMode)
       at Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group)
       at Telerik.Web.UI.GridItemBuilder.CreateGroupSubItems(GridGroupingContext group, GridEnumerableBase enumerable)
       at Telerik.Web.UI.GridItemBuilder.HandleGrouping(GridGroupingContext group, GridEnumerableBase enumerable, Boolean& isGroup, Boolean& isGroupFooter)
       at Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group)
       at Telerik.Web.UI.GridItemBuilder.CreateGroupSubItems(GridGroupingContext group, GridEnumerableBase enumerable)
       at Telerik.Web.UI.GridItemBuilder.HandleGrouping(GridGroupingContext group, GridEnumerableBase enumerable, Boolean& isGroup, Boolean& isGroupFooter)
       at Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group)
       at Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls)
       at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource)
       at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource)
       at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data)
       at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data)
       at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
       at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
       at Telerik.Web.UI.GridTableView.PerformSelect()
       at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
       at Telerik.Web.UI.GridTableView.DataBind()
       at Telerik.Web.UI.RadGrid.DataBind()
       at Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason)
       at Telerik.Web.UI.RadGrid.RebindForExport()
       at Telerik.Web.UI.Grid.Export.TableViewExporter.PrepareForExport()
       at Telerik.Web.UI.Grid.Export.TableViewExporter.page_PreRender(Object sender, EventArgs e)
       at System.EventHandler.Invoke(Object sender, EventArgs e)
       at System.Web.UI.Control.OnPreRender(EventArgs e)
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  InnerException:



Here is my export code behind from my user control
public partial class controls_exportRadGrid : System.Web.UI.UserControl  
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
 
    }         
 
    /// <summary> 
    /// Handles the Click event of the ButtonExcel control.  
    /// </summary> 
    /// <param name="sender">The source of the event.</param> 
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> 
    protected void ButtonExcel_Click(object sender, System.EventArgs e)  
    {  
        ConfigureExport();  
        RadGrid Grid1 = (RadGrid)Page.Master.FindControl("Main").FindControl("RadGrid1");  
        Grid1.MasterTableView.ExportToExcel();  
    }  
 
    /// <summary> 
    /// Handles the Click event of the ButtonWord control.  
    /// </summary> 
    /// <param name="sender">The source of the event.</param> 
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> 
    protected void ButtonWord_Click(object sender, System.EventArgs e)  
    {  
        ConfigureExport();   
        RadGrid Grid1 = (RadGrid)Page.Master.FindControl("Main").FindControl("RadGrid1");  
        Grid1.MasterTableView.ExportToWord();  
    }  
 
    /// <summary> 
    /// Handles the Click event of the ButtonPDF control.  
    /// </summary> 
    /// <param name="sender">The source of the event.</param> 
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> 
    protected void ButtonPDF_Click(object sender, System.EventArgs e)  
    {  
        ConfigureExport();  
        RadGrid Grid1 = (RadGrid)Page.Master.FindControl("Main").FindControl("RadGrid1");  
        Grid1.ExportSettings.Pdf.PageHeight = Unit.Parse("200mm");  
        Grid1.ExportSettings.Pdf.PageWidth = Unit.Parse("500mm");  
        Grid1.MasterTableView.Columns.FindByDataField("STATUS_ID").Visible = false;  
        Grid1.MasterTableView.ExportToPdf();  
    }  
 
    /// <summary> 
    /// Handles the Click event of the ButtonCSV control.  
    /// </summary> 
    /// <param name="sender">The source of the event.</param> 
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> 
    protected void ButtonCSV_Click(object sender, System.EventArgs e)  
    {  
        ConfigureExport(); RadGrid Grid1 = (RadGrid)Page.Master.FindControl("Main").FindControl("RadGrid1");  
        Grid1.MasterTableView.ExportToCSV();  
    }  
 
    /// <summary> 
    /// Configures the export.  
    /// </summary> 
    public void ConfigureExport()  
    {  
        RadGrid Grid1 = (RadGrid)Page.Master.FindControl("Main").FindControl("RadGrid1");  
        Grid1.ExportSettings.ExportOnlyData = true;  
        Grid1.ExportSettings.IgnorePaging = true;  
        Grid1.ExportSettings.OpenInNewWindow = true;  
    }         
}      

Can you provide me with a solution to remove this error and allow me to Export the data?

Thank You!
Mike
Top achievements
Rank 1
 answered on 16 Apr 2009
1 answer
129 views
How can I do to access fileexplorer control that exists on RadEditor control?

What I need to do is to hide the address bar when I click on 'Image Manager' button.

Thanks.
Rumen
Telerik team
 answered on 16 Apr 2009
1 answer
125 views
I'm using rad grid and databind using following code. 

grdMyGrid.DataSource = myDataTable

grdMyGrid.DataBind()


For the first time it works fine.
[Record count: 18]
[Paging Size: 10]
[Pager Display as : 1 2  ]

Then I change the default contents of the 'myDataTable' data table and add more records to the  'myDataTable' data table. 
Then I re-call above code to bind that new data table. 

Thats also working fine. When there are record count more than pager size, It adds those page numbers to the pager(Page moving segment of grid). 
[Record count: 38]
[Paging Size: 10]
[Pager Display as : 1 2 3 4 ]

Again I'm changing the contents of the 'myDataTable' data table and remove many records to the  'myDataTable' data table
Then I re-call above code to bind that new data table. 

In this case, it do not hide the additional page numbers.   
[Record count: 08]
[Paging Size: 10]

[Pager SHOULD Display as : 1 ]
BUT Display it display As : 
[Pager Display as : 1 2 3 4 ]

What would be the issue?
Ur support is highly appreciated.  

Princy
Top achievements
Rank 2
 answered on 16 Apr 2009
5 answers
255 views
Hi all, i was wondering if there is a way to make the treeview check all items when i check a certain node on the treeview eg:

i have a treeview with 60 nodes in it, the top node is called "Select All", when i click on select all i want every other node in the treeview to bo selected.

is this possible and how?

thanks in advance!
Marc Plaxton-Harrison
Top achievements
Rank 1
 answered on 16 Apr 2009
4 answers
130 views
I'm trying to get a ContextMenu to display the root items horizontally. Here's the code:
                           
<telerik:RadContextMenu ID="pageSelectMenu" runat="server" ClickToOpen="false" Flow="Horizontal" > 
    <Items> 
         <telerik:RadMenuItem Text="page1" ></telerik:RadMenuItem> 
         <telerik:RadMenuItem Text="page1b"></telerik:RadMenuItem> 
    </Items> 
</telerik:RadContextMenu>

When this gets displayed, the menu items are vertical. When I look at the rendered output, the ul for the menu has
class="rmActive rmVertical rmGroup rmLevel1"

What am I missing? The control version is 2008.3.1314.35
Princy
Top achievements
Rank 2
 answered on 16 Apr 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?