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

I'm programmatically creating some columns in the Page_Load event (if not postback).  When I create these columns, I'm setting the width, such as:

protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            GridBoundColumn boundColumn = new GridBoundColumn();
            boundColumn.HeaderStyle.Width = new Unit(100, UnitType.Pixel);
            boundColumn.ItemStyle.Width = new Unit(100, UnitType.Pixel);
            boundColumn.ItemStyle.CssClass = "noWrapEllipsis";
            rgCool.MasterTableView.Columns.Add(boundColumn);
}
}


On the initial page load, everything is fine.  However, when an ajax call happens, such as on paging, the columns are still present in the grid, but their width setting is gone (I verified the TD elements have no width when rendered to the browser).

On the demo site is shows a grid persisting column widths across postbacks (or ajax calls).  How can I do this with programmatically created columns?  Should their properties be saved in viewstate just like when the columns are defined in the markup?
Tony
Top achievements
Rank 1
 answered on 14 Jun 2011
3 answers
131 views
Hi,

I have a problem with radgrid export command item buttons. My setup is as follows;

I have a user control within a sharepoint web part. In that user control are multiple rad grids (some housed within child user controls). Each radgrid sits within an ASP.NET update panel. Initially my issue was that while these grids were within an ASP.NET update panel, the export buttons would not work, which was fine as I understood why.

To solve this I added an event handler for the OnItemCreated event of each radgrid. Below is the code for the event handler;

protected void rgv_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridCommandItem)
            {
                Button btncmd = (e.Item as GridCommandItem).FindControl("ExportToExcelButton") as Button;
                if (btncmd != null) { RadScriptManager.GetCurrent(this.Page).RegisterPostBackControl(btncmd); }
  
                btncmd = (e.Item as GridCommandItem).FindControl("ExportToWordButton") as Button;
                if (btncmd != null) { RadScriptManager.GetCurrent(this.Page).RegisterPostBackControl(btncmd); }
  
                btncmd = (e.Item as GridCommandItem).FindControl("ExportToCsvButton") as Button;
                if (btncmd != null) { RadScriptManager.GetCurrent(this.Page).RegisterPostBackControl(btncmd); }
            }
        }

While testing this code change outside of SharePoint (standard asp.net website under IIS7), this worked just fine, I could export to excel as intended, and everything else within the update panel was still working correctly with respect to ajax.

As soon as I published this out to my sharepoint environment (SharePoint 2010 SP1) to test, I ran into an issue. Export to excel still worked just fine, but after using any of the export buttons to download a document, I could no longer interact with the application, in that nothing on the web part would post back anymore (I have a number of rad combo boxes, toolbars etc both within the update panels and outside of the update panels).

I used the same markup for a rad script manager in both the non sharepoint test website and in the sharepoint masterpage of the site hosting the web part.

<telerik:RadScriptManager id="ScriptManager" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true" ScriptMode="Release"/>

Do you have any ideas why this might be? Or potential work arounds? At the moment its not feasible to change from the current method of using ASP.NET update panels to telerik ajax controls without significant reworking of the application (which is quite large). So any work arounds would be much appreciated.

Thanks
BizData
Top achievements
Rank 1
 answered on 14 Jun 2011
4 answers
197 views
Hello ,
i want to hide "today" link in control .
any ideas ?
Karam
Top achievements
Rank 2
 answered on 13 Jun 2011
2 answers
94 views

Hello all,

I'm interested in displaying a dynamically loaded user control inside a RadToolTipManager using the AjaxUpdate method from javascript when using the onRowDblClick event of the RadGrid.

I've tried calling the following, which does open the tooltip, but does not call the ajaxupdate:

 function editRole(sender, eventArgs) {


                var tooltip = $find('<%= ttAddVariable.ClientID %>');

                setTimeout(function () {
                    tooltip.set_targetControlID(sender);
                    tooltip.show();
                }, 100);  
            }
Mooka
Top achievements
Rank 1
 answered on 13 Jun 2011
9 answers
205 views
Hello, I'm using the newest version of RadControls for ASP.NET, and I've got a problem with launching the edit mode for RadGrid - it works like a charm for one instance of RadGrid, but for another - which is hierarchical - it doesn't. I am able to set edit mode manually - by EditColumn only.

My hierarchical grid looks is created in following way:

<telerik:RadGrid runat="server"
    ID="Grid"
    EnableAJAX="True"
    AllowMultiRowEdit = "True"
    EditMode="InPlace"
    OnItemDataBound="Grid_ItemDataBound"
    OnDetailTableDataBind="Grid_DetailTableDataBind"
    OnPreRender="Grid_PreRender"
    OnUpdateCommand="Grid_ItemUpdate"
    OnItemCreated="Grid_ItemCreated"
    DataSourceID="SqlDataSource1"
    AutoGenerateColumns="false">
      
    <MasterTableView DataKeyNames="MASTER_ID" >
     
     <DetailTables>
                            <telerik:GridTableView                           
                             EditMode="InPlace"
                            Name="Child" AutoGenerateColumns="False" Width="100%"
                              DataKeyNames="CHILD_ID" runat="server">
 
                                <Columns>                                  
                                 <telerik:GridEditCommandColumn /> 
                                   
                                <telerik:GridBoundColumn  DataField="CHILD_ID" HeaderText="CHILD_ID" ReadOnly="True"
                   SortExpression="CHILD_ID" UniqueName="CHILD_ID">
                                </telerik:GridBoundColumn>       
                                 
                                    
                                <telerik:GridBoundColumn  DataField="CHILD_Text" HeaderText="CHILD_Text" ReadOnly="False"
                   SortExpression="CHILD_Text" UniqueName="CHILD_Text">
                                </telerik:GridBoundColumn>                        
 
                   
                                </Columns>
                                </telerik:GridTableView>
                                 
    </DetailTables>                          
     
    <Columns>   
 
    <telerik:GridBoundColumn  DataField="CHILD_ID" HeaderText="CHILD_ID" ReadOnly="True"
                   SortExpression="CHILD_ID" UniqueName="CHILD_ID">
                                </telerik:GridBoundColumn>
                                 
    <telerik:GridBoundColumn  DataField="MASTER_ID" HeaderText="MASTER_ID" ReadOnly="True"
                   SortExpression="MASTER_ID" UniqueName="MASTER_ID">
                                </telerik:GridBoundColumn>     
                
                           
    </Columns>   
     
    </MasterTableView>
    
    </telerik:RadGrid>

And function, which is trying to turn on edit mode, looks like:

private void Grid_PreRender(object sender, System.EventArgs e)
{
 
if (!IsPostBack)
{
 
 foreach(GridItem item in Grid.MasterTableView.Items)
 {
  if (item is GridEditableItem)
  {
   GridEditableItem editableItem= item as GridDataItem;
   editableItem.Edit = true;
  }
 }
 Grid.Rebind();
}
 
}

Any help would be appreciated.
Daniel
Top achievements
Rank 2
 answered on 13 Jun 2011
2 answers
139 views
I have a template column in a RadGrid that has a RadMaskedTextBox in it.

When the user selects a row, the entire row is changed color except for these RadMaskedTextBoxes.

I want to change their background color to red when the user selects the row.

I trigger an event to do this with the following in the ClientSettings section of the RadGrid HTML.

 

<ClientEvents OnRowSelected="OnRowSelected" />

The javascript event handler is:

function OnRowSelected(sender, eventArgs) {
    var MasterTable;
    var aryAllRows;
    var rowOneRow;
    var txtItemUPC;
    MasterTable = sender.get_masterTableView();
    aryAllRows = MasterTable.get_dataItems();
    rowOneRow = aryAllRows[eventArgs.get_itemIndexHierarchical()];
    txtItemUPC = rowOneRow.findControl('txtItemUPC');
    txtItemUPC.get_styles().EnabledStyle[0] += "background-color: Red";
}

I can check txtItemUPC.get_value() to see that txtItemUPC is correctly set to the RadMaskedTextBox.

The value of txtItemUPC.get_styles().EnabledStyle[0] is changed by the above code.  However, the RadMaskedTextBox doesn't display any differently.

As a test, I set txtItemUPC.get_styles().EnabledStyle[0] to a garbage value and not receive any error messages.

Can you point out what I am doing wrong?  Note that there is no set_styles option, I believe.

John
Top achievements
Rank 1
 answered on 13 Jun 2011
3 answers
134 views
Hi,
Im new to asp.net and I am struggling on how to access the Advanced Form save event to send an email after every new appointment.  Any examples on how to accomplish this would be great.  I would also like to grab the values from the advanced form and include them in the email.

Thank you,
Gus
Gus
Top achievements
Rank 1
 answered on 13 Jun 2011
4 answers
238 views
I am partially populating a large tree and enabling load on demand and tri-state checkboxes.  At the time of partial population of the tree, I know which load-on-demand nodes have checked children, but I can find no way to communicate this to the tree object.  Node.CheckedState is read-only.  If I can't do this, checkboxes are potentially inaccurate until the entire tree has been expanded, which eliminates the value of load-on-demand.

Am I missing something?  Is there a work-around for this?  If not, please consider adding this capability in a future release.
Nikolay Tsenkov
Telerik team
 answered on 13 Jun 2011
3 answers
102 views
I have a user control inside a grid for editing. Everything works as expected except one thing.

I have an "Update" event on a toolbar in the control. The event checks the database for duplicate data. iIf another record exists it cancels the update. I'd like to leave the control open but the "Update" event goes up to the grid and it closes.

In classic RadControls you could do
e.cancel(true);
on the toolbar event.... is there a simple way to accomplish the same effect?
Peter
Telerik team
 answered on 13 Jun 2011
2 answers
92 views
I have a two docks in a horizontal zone.

When Dock_1 undocks I force Dock_0 to resize to 100% of the width of the zone.  
This restricts the floating dock from resizing larger.  Is this by design? 

One workaround is to size Dock_0 narrower and than the floating Dock_1 can be resized larger. 

Is there a proper technique to allow my floating dock to resize at will while Dock_0 occupies 100% of the zone?


Joel
Top achievements
Rank 1
 answered on 13 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?