Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
175 views
Hi,

I am trying to create a dynamic CommandItemTemplate based on the selected item in the Grid.  I have the ClientSettings.EnablePostBackOnRowClick set to true and Selecting-AllowRowSelect also set to true.  I have tried to handle this in two different ways:

First, I tried to handle the ItemCommand event.  I was able to get a reference to the GridDataItem that was selected and read the values, but setting the MasterTableView.CommandItemTemplate to my custom ITemplate object did not have any visual effect on the CommandItem.  I believe this is because the commandItem has already been rendered at this point and doesn't get re-rendered.

My next attempt was to handle the ItemCreated event.  I was now able to catch the creation of the CommandItem and get a reference to it, but now the Grid.SelectedItems collections was empty.  Perhaps this hasn't been set yet at this point in the control lifecycle.

I'm open to other ways of doing this.  Maybe by creating all of the controls that I want declaratively and just enabling or disabling them dynamically, but if the control has already been rendered or if I can't get at the SelectedItems collection, this still won't do me any good.

Any suggestions?  Also, what are my options for doing this using client-side javascript instead?

Thanks,

Billy
Georgi Krustev
Telerik team
 answered on 07 Apr 2009
3 answers
217 views
I am running into an issue and want to see if there is a standard way to do this.

I want to select a grid item on the client and keep the the styles defined in the grid.  I have the following event called when a checkbox is clicked in the grid.

           function selectRow(id, rowIndex) {  
 
               var grid = $find("<%= gvProperties.ClientID %>");  
 
               var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();  
 
               //grid.get_masterTableView().selectItem(rowControl, true);  
               grid.get_masterTableView().selectItem(rowControl);  
 
                 
               rowControl.style.backgroundColor='#c7c7c7';  
                 
               return true; 

The rowControl.style.background gets set correctly but I really want to use what is defined in SelectedItemStyle.  My main question is when the checkbox is unclicked I want to use what is set for the ItemStyle or the AlternateItemStyle.

How do I know what kind of item (regular or Alternate) I have?

Also, why doesn't the 'selectItem' method already already highlight the row using the SelectedItemStyle?

Thanks.
Iana Tsolova
Telerik team
 answered on 07 Apr 2009
4 answers
236 views
Hi All,

I have one hidden field in master page. I have created the property for this hidden field so that I am able to update the value of this hidden field from content page.
It works fine when there is no RadAjaxPanel in content page.
But if event get fired with the controls which are inside RadAjaxPanel in content page then the value of hidden field dosent get updated.
I have palced the hidden field in another RadAjaxPanel but still it is not working. In Update panel there is one property i.e. UpdateMode = "Always". I didn't found such property in RadAjaxPane. I just want,  hidden field should get updated for every sync or async postback always.
Sebastian
Telerik team
 answered on 07 Apr 2009
3 answers
85 views

I have worked around the floating issue with some parts of RadControls e.g. radeditor and upload, applying the position:absolute property to a css class in fildset container. The floating issue is solved but now the scrolling does not update the RadPane in real time mode, the radpane is update only when release mouse event occurs.

Can we refine this workaround this issue?

Thanks

Gilberto
Gilberto
Top achievements
Rank 1
 answered on 07 Apr 2009
1 answer
114 views
Hi,

Using the Iana method on this post : http://www.telerik.com/community/forums/aspnet-ajax/ajax/radpanel-when-call-a-service.aspx
I want to write something like that to ajaxify a button click.

 <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
        <AjaxSettings>              
            <telerik:AjaxSetting AjaxControlID="ClearBtn">  
                <UpdatedControls> 
                   <telerik:AjaxUpdatedControl ControlID="ClearBtn" LoadingPanelID="AjaxLoadingPanel">  
                   </telerik:AjaxUpdatedControl> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
</telerik:RadAjaxProxyManager> 

Now, I want to do the same thing but on a RadMenuItem. I define my RadMenu like that :

<telerik:RadMenu ID="SaveBtn" ClickToOpen="true" runat="server" EnableEmbeddedSkins="false" CausesValidation="false" OnItemClick="SaveBtn_Click">  
                    <Items> 
                        <telerik:RadMenuItem Text="save">  
                            <Items> 
                                <telerik:RadMenuItem Text="text 1" 
                                  Value="value 1" /> 
                                <telerik:RadMenuItem Text="text 2" 
                                    Value="value 2" /> 
                                <telerik:RadMenuItem Text="text 3" 
                                    Value="value 3" /> 
                            </Items> 
                        </telerik:RadMenuItem> 
                    </Items> 
                </telerik:RadMenu> 

How to ajaxify the click on the first, second and third RadMenuItem using the same method as above ? (please pay attention I want to use the ClickToOpen set to true)

Thank you,

Sabrina
Shinu
Top achievements
Rank 2
 answered on 07 Apr 2009
1 answer
315 views

   Hi,

      I want to add the rad tooltip for the selected cell of radgrid.

      My problem is :i m getting tooltip for every cell.i want to diplay
 
      tooltip for selected cell only.

      I used the following javascript to select the multiple cells of
      the radgrid.

      Here is the javascript code:
     

         <script type="text/javascript">
   
    function RowCreated(sender, eventArgs)
     {
         var dataItem = eventArgs.get_gridDataItem();
       
        for (var i = 0; i < dataItem.get_element().cells.length; i++)
       
           {
                dataItem.get_element().cells[i].onclick = function()
              {
                this.selected = this.selected == true ? false : true;
                this.className = "ClickClass";
            };
        }
    }
</script>

    and in client settings of rad grid
    ----------------------------------

 

<ClientSettings>
   <Selecting AllowRowSelect="false" ></Selecting>
  
   <ClientEvents OnRowCreated = "RowCreated" ></ClientEvents>
</ClientSettings>

 

     and for tooltip i used the following code:
     ------------------------------------------

protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {

     
          if (e.Item is GridDataItem)
            {

               foreach (GridTableCell cell in e.Item.Cells)
              {

                   cell.ToolTip = cell.Text;

                }
            }

        }

 

      so...instead of this how to get the tooltip of radgrid.....when the cell is selected?

      pls ..help me to solve this prob..

    thanks in advance

Princy
Top achievements
Rank 2
 answered on 07 Apr 2009
5 answers
636 views
Hi!

When using RadDate/RadDateTimePicker in formview insertitemtemplate it´s throwing a null reference exception if no date has been selected.

Code: 

<radControls:DateTimePicker ID="dateTimePicker1" runat="server"

FocusedDate='<%#DateTime.Now %>'

DbSelectedDate='<%#Bind("PremisesStartDate")%>'

TabIndex="4"/>

BR
Marcus

Grendizer
Top achievements
Rank 1
 answered on 07 Apr 2009
1 answer
99 views
We have a menu, with 900+ items (4 layers) and it seems pretty slow. When we toggle between different menu items there is about 10 seconds delay for the menu to hide so we can navigate. Is there something we can do to tune the performance? Thanks.
Paul
Telerik team
 answered on 07 Apr 2009
1 answer
192 views
I am exporting content from a RadGrid.  With the default settings, the grid data exports perfectly.  As soon as I make a change to any of the ExportSettings, I get a blank spreadsheet in Excel.  Has anyone else run into this problem?

I have an OnBubbleEvent setup in my Grid class.  When the user has clicked "Export Grid" from the GridToolBar inside the Grid CommandItemTemplate, I bubble the event up to the grid.  Eventually, the parameters are passed into the OnBubbleEvent which simply calls the code below:

 

        protected void CreateExportFile(string[] exportResults)  
        {  
            //Hide the GridToolBar  
            this.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;  
            //Hide the Pager  
            this.MasterTableView.PagerStyle.Visible = false;  
            //Hide the PreviewIcon Column  
            foreach (GridColumn col in this.MasterTableView.Columns)  
            {  
                if (col.ColumnType == "GridTemplateColumn")  
                {  
                    col.Visible = false;  
                }  
            }  
            //Hide the ExpandColumn  
            (this.MasterTableView.GetItems(GridItemType.Header)[0] as GridHeaderItem)["ExpandColumn"].Visible = false;  
            foreach (GridDataItem dataItem in this.MasterTableView.Items)  
            {  
                dataItem["ExpandColumn"].Style["display"] = "none";  
                dataItem["ExpandColumn"].Visible = false;  
            }  
 
            switch (exportResults[0])  
            {  
                case "Excel":  
                    {  
                        SetExportSettings(exportResults);  
                        this.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.Html;  
                        this.MasterTableView.ExportToExcel();  
                        this.MasterTableView.Rebind();  
                        break;  
                    }  
                case "Word":  
                    {  
                        SetExportSettings(exportResults);  
                        this.MasterTableView.ExportToWord();  
                        break;  
                    }  
                case "CSV":  
                    {  
                        SetExportSettings(exportResults);  
                        this.MasterTableView.ExportToCSV();  
                        break;  
                    }  
            }  
        }  
 
        private void SetExportSettings(string[] exportParameters)  
        {  
            //0=Format, 1=IncludeColumnNames, 2=IgnorePaging, 3=OpenInNewWindow 
            this.ExportSettings.ExportOnlyData = false;// !(Convert.ToBoolean(exportParameters[1])); //IncludeColumnNames  
            this.ExportSettings.IgnorePaging = true; // Convert.ToBoolean(exportParameters[2]); //IgnorePaging  
            this.ExportSettings.OpenInNewWindow = true; // Convert.ToBoolean(exportParameters[3]); //OpenInNewWindow  
        }  
 

 

 

 

 

 

 

 

 

Pavlina
Telerik team
 answered on 07 Apr 2009
14 answers
196 views
Hello,

I want to add a radpanel on a asp page.
When I click on a button, a call to a service is made and this call can take some seconds when there is the postback. I would like to show a RadAjaxLoadingPanel. 

I don't know on which controls I have to put the radpanel to show the RadAjaxLoadingPanel.

Can you help me ?

Thanks,

Sabrina
Sabrina
Top achievements
Rank 1
 answered on 07 Apr 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?