Telerik Forums
UI for ASP.NET AJAX Forum
10 answers
304 views
Hi All

I have been trying to control the scroll height of a grid using javascript,
I have encountered some problems as the grids are held within pageviews and the client height always returns 0 when in a container of some kind!!!
To work around this is used the row count of the grid to determine the scroll height:
function GridCreated(sender, args) {
                   var scrollArea = sender.GridDataDiv;
                   var masterTable = sender.get_masterTableView();                 
                   var itemCount = masterTable.get_dataItems().length;
                     
                   if (itemCount == 0) {
                       scrollArea.style.height = 17 + "px";
                   }else if (itemCount < 10) {
                       scrollArea.style.height = Math.round((itemCount * 24)) + "px"
                   }
                     
               }

However i am not 100% happy with this as if the row size increases in height the grid will not render correctly.
Is there a work around to get the client height within a page view/container.

Your help would be most appricated.

Best Regards

Cush
Cush
Top achievements
Rank 1
 answered on 27 Jul 2011
2 answers
158 views
Hi,

Here's the situation:

I have a search box in a master page. I expose the click event of the search button to my actual page that contains a radtabstrip control. The event then takes the keyword, and creates a new table for that keyword with the value "keyword" (let's call it SearchTab). This also means that I'm also creating a corresponding PageView that sends the keyword as a querystring to the page that's set in the "ContentURL" property, let's call it "SearchPage".

This web form contains a simple label, for which the value is retrieved from the querystring.

If the user puts a keyword and the tabstrip control does not contain a tab with the the value keyword, then I will create a new tab, otherwise, I will go and select the already existing tab.

On to the problem:

When I do a search for a new keyword, all works fine and dandy.
When I do a search for an already existing keyword, and I go to select the existing tab, nothing is displayed in the tab anymore. This keeps happening if i change tabs again and then go back to that same tab. I also tried w/ and w/o AutoPostback.

Here's the simple sample code that I'm using:

edit: I actually removed the code that sets the contentURL and replaced it by a simple calendar just to check if it might be related to that, and that's what I ended up copying. Sorry about the error, but it doesn't make a difference (just in case you're wondering).

if (RadTabStrip1.FindTabByValue(keyword) == null)
{
    // Create new tab and corresponding pageview and then select it.
   RadTab SearchTab = new RadTab(String.Format("Search: {0}", keyword), keyword);
   RadPageView SearchPage = new RadPageView();
 
   SearchPage.ID = keyword;
   SearchPage.Controls.Add(new Calendar());
   SearchTab.PageViewID = SearchPage.ID;
 
   RadMultiPage1.PageViews.Add(SearchPage);
   RadTabStrip1.Tabs.Add(SearchTab);
 
   RadTabStrip1.FindTabByValue(keyword).Selected = true;
   RadMultiPage1.FindPageViewByID(keyword).Selected = true;
}
else
{
    // Select the already existing tab
   RadTabStrip1.FindTabByValue(keyword).Selected = true;
   RadMultiPage.FindPageViewByID(keyword).Selected = true;
}


Any ideas on why this is not working?

Thank you.
Dimitar Terziev
Telerik team
 answered on 27 Jul 2011
2 answers
115 views

I need to use the DockToggleCommand in order for the user to switch how the user will view the data within the dock. (ie. Grid Format vs. Chart Format).  The command button would autopostback and switch views depending ont he State of the toggle button. How do I need to check for the state of the ToggleCommand server side so I can return the correct data format and change the command graphic to an appropriate icon?

The following code gets fired but always returns "Primary".

protected void RadDock_Command(object sender, DockCommandEventArgs e)
{
    
    if (e.Command.Name == "MyCustomCommand")
    {
        RadDock rd = (RadDock)sender; 
         DockToggleCommand toggleCommand = e.Command as DockToggleCommand;
        string strState = toggleCommand.State.ToString();
        TextBox1.Text = strState;
    }
      
      
}




Michael
Top achievements
Rank 1
 answered on 27 Jul 2011
7 answers
204 views
I am running version 2011.2.712.40 which I think is the latest version. When my project loads the first time I get the following error:

Microsoft JScript runtime error: Unable to get value of the property 'tHead': object is null or undefined

The highlighted code is in the RadTreeList prototype.
Telerik.Web.UI.RadTreeList.prototype=
...
_getTableHeaderRow:function(b){var c=null;
if(b.tHead){for(var a=0;
a<b.tHead.rows.length;
a++){if(b.tHead.rows[a]!=null){if(b.tHead.rows[a].cells[0]!=null){if(b.tHead.rows[a].cells[0].tagName!=null){if(b.tHead.rows[a].cells[0].tagName.toLowerCase()=="th"){c=b.tHead.rows[a];
break;
}}}}}}return c;
},
...

The declaration of the RadTreeList looks like this:

                <telerik:RadTreeList ID="myData" runat="server" DataSourceID="sqlData" DataKeyNames="ID" ParentDataKeyNames="ParentID" AutoGenerateColumns="false" OnDataBound="myData_DataBound">
                    <Columns>
...
                    </Columns>
 
                    <NoRecordsTemplate>
                        <span>There is no data selected!</span>
                    </NoRecordsTemplate>
                </telerik:RadTreeList>


Is there something I am missing that would cause this error as it does not happen on version 2011.1.519.40?
Martin
Telerik team
 answered on 27 Jul 2011
3 answers
123 views
Hello,

I'm wonder if there is any chart which behaves exactly as the the Pie chart but in different shap (Please view the attached image for illustration)?

Regards,
Bader
Evgenia
Telerik team
 answered on 27 Jul 2011
1 answer
148 views
I am trying to dynamically create a Notification in code behind, however when I call the Show() method, it gives me an Object is not set to the instance of an object error.

I am assuming that is because this control must be added to the page's controls?

Is that the case?

I have a large project with many pages and controls and don't want to have to add the markup on every since page of my project.
Marin Bratanov
Telerik team
 answered on 27 Jul 2011
2 answers
537 views
Hi,

  I want to populate my radgrid with the data using GridBoundColumn and dropdown controls.

I am able to place the GridBoundColumn like

<Columns>
      <telerik:GridBoundColumn ReadOnly="true" SortExpression="Name" HeaderText="Employee Name"
      DataField="EmployeeName" ItemStyle-Width="150px"><ItemStyle Width="150px"></ItemStyle>
      </telerik:GridBoundColumn>
</Column

I want to add a dropdown box next to the above field to populate data. How can I do this?

Regards,
Aradhya
abinav
Top achievements
Rank 1
 answered on 27 Jul 2011
1 answer
101 views
HI,
  
<telerik:GridHyperLinkColumn HeaderStyle-Width="160px" DataTextFormatString="'{0}'"
                                        ItemStyle-HorizontalAlign="Center" DataNavigateUrlFields="ItemCode" UniqueName="ItemCode"
                                        DataNavigateUrlFormatString="javascript:OpenItemCode('{0}');" HeaderText="Item Code"
                                        DataTextField="ItemCode" />


This is a column in my directly bound grid.

This form has been opened from menu

Now i want to open another form from the menu using the above hyperlink

the following is the script for the code mentioned above

  function OpenItemCode(index)
 {
                var cmbcolItemNo = index;
  if (cmbcolItemNo != "")
 {
                    GetRadWindow().BrowserWindow.OpenWindow('Warehousing/frmItemMaster.aspx?ItemCode=' + cmbcolItemNo, "ItemMaster", "Images/square.png");
                }
 }

this code works perfectly in IE but does not work in Chrome
 Please give me some suggestion to solve this problem
Marin Bratanov
Telerik team
 answered on 27 Jul 2011
3 answers
198 views
Hi

I am trying to implement some validation on new folder name so that when a user changes a folder name to another name, he/she does not enter an invalid char in the new name.

When doing so, I tried to rename a folder from (name) to (name/), i.e I inserted a forward slash at the end of the folder name.

When presseing enter, the application timed out and my (RadFileExplorer1_ItemCommand) event never got triggered.

I also found another issue:

If I put the slash in the middle of the new folder name (i.e. na/me), in the RadFileExplorerEventArgs, and newpath parameter will be wrong!

I suggest that there should be internal validation on invalid characters both in file and folder names. Also, the newpath parameter should contain the new name of the folder rather than the whole path, so that if the developer did his/her own validation he can easily find the new name. This is particularly useful if the user entered a slash in the new folder name then If I parsed the full name I still get errors.

I hope my points are clear

Regards

Dobromir
Telerik team
 answered on 27 Jul 2011
1 answer
152 views
I have a menu on a master page that opens a radwindow (window1)  this window contains a radgrid.  In the radgrid I have some code that opens a second window (window2) to allow editing of the grid contents.  This works ok, but Im having a problem referencing window2 if my .aspx page is in a subdirectory and not the site root.  Heres whats happening

I activate window2 when my main page is

/Website/default.aspx    the page is in the root (using this bit of code var oBrowserWnd = GetRadWindow().BrowserWindow;)

I call this code

var oBrowserWnd = GetRadWindow().BrowserWindow;
       
 oBrowserWnd.radopen("ArtistAdmin/BandMemberEditForm.aspx?ID=" + id, "BandMemberDialog");
             
  return false;

the edit form is found and opens ok

If the .aspx page happens to be in a subdirectory, eg

/Website/ArtistAdmin/ArtistAdminPage.aspx

the window cant be found because BrowserWindow is
/website/artistadmin/artistadmin.aspx

so radopen tries this


/website/artistadmin/artistadmin/artistadmin.aspx

How can I force radopen to use the root directory of my site ?

Marin Bratanov
Telerik team
 answered on 27 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
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
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?