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

I am having issues with the left scroll button not working if I set the selected tab on the server side and then call scrollIntoView() in the OnClientLoad event.

My tabstrip is configured as below:

<telerik:RadTabStrip ID="RadTabStrip1" runat="server" AutoPostBack="false" OnClientLoad="ScrollToActiveTab" ScrollButtonsPosition="Middle" ScrollChildren="true" PerTabScrolling="true" Width="708">

 </telerik:RadTabStrip>

 



After adding tabs to the TabStrip programmatically, I am setting the selected tab like so:

Telerik.Web.UI.RadTab selectedTab = RadTabStrip1.FindTabByUrl(url);

 if (selectedTab != null)

 {

selectedTab.SelectParents();

selectedTab.Selected = true;

 }



Then, in the OnClientLoad event, I am calling this method:

function ScrollToActiveTab(sender, eventArgs) {

var selectedTab = sender.get_selectedTab();

if (selectedTab != null) {

 selectedTab.scrollIntoView();

}

}



In the browser, the correct tab is selected, and everything is rendered fine except that when I click the left scroll button to scroll to tabs that come before the selected one, I get this javascript error:

tabs.getTab(this._currentTabIndex + _118) is undefined

 


T. Tsonev
Telerik team
 answered on 21 Aug 2009
9 answers
582 views
Hello,

after I add a FormDecorator, VS2008 is gives me an error for the javascript generated. This is the line:

var _8=_6.__lookupSetter__("checked");

And these are the 2 error messages returned:

Microsoft JScript runtime error: Object doesn't support this property or method

Microsoft JScript runtime error: 'Telerik.Web.UI.FormDecoratorDecoratedControls.Default' is null or not an object

What would be the cause?

Thank you!
Lini
Telerik team
 answered on 21 Aug 2009
2 answers
118 views
Hi, I have an Horizontal RadMenu on the header of the page of a Master Page, which child items expand vertically.  In a child page of such Master Page, I have a RadDockLayout with several RadDockZones and RadDocks inside.  The issue is that when I expand my RadMenu to select one of its child items, the expanded menu goes underneath my RadDocks instead of expanding on top of them.  I have tried solving this problem tinkering with the Z-Indexes of the items in the page to no avail.  This is happening in IE8 Compatibility View and IE7, however, in Firefox 3.5 and IE8 (without compatibility view) it is working perfectly.

What else can I do?? Is the Master Page the problem??

Thanx,
Manuel
Helen
Telerik team
 answered on 21 Aug 2009
1 answer
175 views
Hey,

I am having problems with my control validation.  I am using the validation that you provided on this page: Validation.  My problem is that when my application calls my insert or update I am not able to grab the values inside my grid that have the validators attached to them.  When I remove the validation my code grabs the vaules properly.  Any help would be great.

Here is the code that is grabbing data out of my grid:

GridEditableItem editedItem = e.Item as GridEditableItem;
            GridEditManager editManager = editedItem.EditManager;

            int i = 0;
            foreach (Telerik.Web.UI.GridColumn column in e.Item.OwnerTableView.RenderColumns)
            {
                if (column is IGridEditableColumn)
                {
                    IGridEditableColumn editableCol = (column as IGridEditableColumn);
                    if (editableCol.IsEditable)
                    {
                        IGridColumnEditor editor = editManager.GetColumnEditor(editableCol);

                        if (editor is GridDropDownColumnEditor)
                        {
                            CoverageUpdates[i] = (editor as GridDropDownColumnEditor).SelectedValue;
                            i++;
                        }
                        else if(editor is GridNumericColumnEditor)
                        {
                            CoverageUpdates[i] = (editor as GridNumericColumnEditor).Text;
                            i++;
                        }
                        else
                        {
                            CoverageUpdates[i] = (editor as GridTextColumnEditor).Text;
                            i++;
                        }
                    }
                }
            }

Here is my validator code:

if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                GridEditableItem item = e.Item as GridEditableItem;

                GridNumericColumnEditor editor = (GridNumericColumnEditor)item.EditManager.GetColumnEditor("CoverageLimit");

                TableCell cell = (TableCell)editor.NumericTextBox.Parent;

                RequiredFieldValidator validator = new RequiredFieldValidator();
                editor.NumericTextBox.ID = "clID";
                validator.ControlToValidate = editor.NumericTextBox.ID;
                validator.ErrorMessage = "Required";
                cell.Controls.Add(validator);

                GridNumericColumnEditor editor2 = (GridNumericColumnEditor)item.EditManager.GetColumnEditor("Deductible");

                TableCell cell2 = (TableCell)editor2.NumericTextBox.Parent;

                RequiredFieldValidator validator2 = new RequiredFieldValidator();
                editor2.NumericTextBox.ID = "dId";
                validator2.ControlToValidate = editor2.NumericTextBox.ID;
                validator2.ErrorMessage = "Required";
                cell2.Controls.Add(validator2);
            }






Thanks,

Kyle Jones
Iana Tsolova
Telerik team
 answered on 21 Aug 2009
1 answer
133 views
Hello,
Are there plans to add richer keyboard support to this control? Peter Blum's keyboard support is very extensive for their date picker and I would love to see that level of support in your control. Right now, I have to add some javascript to put the current date in focus and then use tabs to change dates. I would love to be able to use my arrow keys to jump weeks, the T key to get today's date, and other shortcuts that make sense.
Thanks
-marcos
Tsvetoslav
Telerik team
 answered on 21 Aug 2009
1 answer
201 views
Hi,
How to clear items in drop down of radcombobox?

 

RadComboBox.DataSource = dvBrowse.Table;

RadComboBox.DataBind();

protected void RadComboBox_ItemDataBound(object sender, RadComboBoxItemEventArgs e)
        {
           
            e.Item.Value = ((DataRowView)e.Item.DataItem)[0].ToString();
            e.Item.Text = ((DataRowView)e.Item.DataItem)[1].ToString();
        } 

this doesnt clear the old items in drop down.

Shinu
Top achievements
Rank 2
 answered on 21 Aug 2009
0 answers
118 views
I used version Q2-2009, and I'm trying to mimic yahoo mail site
but I have some problems with that UseStaticHeaders
when I debug my site with IE 7, in normal browser size, I have this, pretty good.
http://i20.photobucket.com/albums/b222/grandholy/mail1.png
when I maximize the browser size, I have this, not bad
http://i20.photobucket.com/albums/b222/grandholy/mail2.png
but when I turn browser size to normal again, oops, there's something wrong
http://i20.photobucket.com/albums/b222/grandholy/mail1.png
and I have 3 question
1- how to fix this problem?
2- I want my radgrid auto resize like yahoo mail, as you see, there's still a Horizontal scrollbar in it
3- If I try to click the link button in my radgrid and I'm using ajax, the first time it's looked like the page reloading, but the second click is fine, I wonder why?
oh, and one more thing, when I click in the link button first time, it's ok, but if I click the second time without scrolling, the radgrid's record position come back to 1st record , I wonder why?
this is my entire code
http://www.mediafire.com/?zm2zfknj4wu
and the problem in the Mails.ascx file =.=
please reply asap, thank you.
Nguyễn Đại Dương
Top achievements
Rank 1
 asked on 21 Aug 2009
1 answer
86 views
   protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)  
    {  
        if (e.CommandName == RadGrid.InitInsertCommandName)  
        {  
            GetData(RadGrid1, "SELECT [RoleID],[Rolename] FROM [vw_UsersinRoles] WHERE [UserID] = " + this.DropDownList4.SelectedValue + " ORDER BY [Username]");  
        }  
        else if (e.CommandName == RadGrid.UpdateCommandName)  
        {  
        }  
        else if (e.CommandName == RadGrid.DeleteCommandName)  
        {  
            SQLQuery("DELETE FROM [UsersinRoles] WHERE [UserID] = " + this.DropDownList4.SelectedValue + " AND [RoleID] = " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["RoleID"].ToString());  
        }  
        else if (e.CommandName == RadGrid.EditCommandName)  
        {  
        }  
        else if (e.CommandName == RadGrid.PerformInsertCommandName)  
        {  
            GridEditFormInsertItem insertedItem = (GridEditFormInsertItem)e.Item.OwnerTableView.GetInsertItem();  
            string RoleIDstring = (insertedItem["RadComboBox2"].Controls[0] as RadComboBox).SelectedValue;  
            int RoleID = Convert.ToInt16(RoleIDstring);  
            SQLQuery("INSERT INTO [UsersinRoles] ([UserID],[RoleID]) VALUES (" + this.DropDownList4.SelectedValue + "," + RoleID + ")");  
        }  
    }  
 public static void GetData(RadGrid RadGrids, String SqlQuery)  
    {  
        DataTable dtTable = new DataTable();  
        string conn = ConfigurationManager.ConnectionStrings["SecurityConnectionString"].ToString();  
        SqlDataAdapter sqladp = new SqlDataAdapter();  
        SqlConnection sqlconn = new SqlConnection(conn);  
        sqlconn.Open();  
        try 
        {  
            string selectQuery = SqlQuery;  
            sqladp.SelectCommand = new SqlCommand(selectQuery, sqlconn);  
            sqladp.Fill(dtTable);  
            RadGrids.DataSource = dtTable;  
            RadGrids.DataBind();  
        }  
        finally 
        {  
            sqlconn.Close();  
        }  
    }  
 
    public static void SQLQuery(String SqlQuery)  
    {  
        string conn = ConfigurationManager.ConnectionStrings["SecurityConnectionString"].ToString();  
        SqlConnection sqlconn = new SqlConnection(conn);  
        sqlconn.Open();  
        try 
        {  
            SqlCommand cmd = new SqlCommand(SqlQuery, sqlconn);  
            cmd.ExecuteNonQuery();  
        }  
        finally 
        {  
            sqlconn.Close();  
        }  
    } 
  <telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticUpdates="True" AllowAutomaticInserts="True" 
        AllowAutomaticDeletes="True" AllowPaging="True" EnableLinqExpressions="False" 
        OnItemCommand="RadGrid1_ItemCommand" AutoGenerateColumns="False" Width="310px" 
        BorderColor="Black" BorderWidth="1px" GridLines="None">  
        <HeaderContextMenu EnableTheming="True">  
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </HeaderContextMenu> 
        <MasterTableView DataKeyNames="RoleID" CommandItemSettings-AddNewRecordText="Add New Role" 
            CommandItemDisplay="Top">  
            <CommandItemSettings AddNewRecordText="Add New Role"></CommandItemSettings> 
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridTemplateColumn UniqueName="DeleteColumn" ItemStyle-Width="16px" AllowFiltering="false">  
                    <HeaderStyle Width="16px" /> 
                    <ItemTemplate> 
                        <asp:ImageButton ID="imgbtnDelete" Width="14px" ToolTip="Delete Contact" runat="server" 
                            CommandName="Delete" ImageUrl="~/images/recycle.jpg" OnClientClick="javascript:if(!confirm('This action will delete the selected contact. Are you sure?')){return false;}" /> 
                    </ItemTemplate> 
                    <ItemStyle Width="16px"></ItemStyle> 
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn HeaderText="Rolename" UniqueName="RolenameColumn">  
                    <EditItemTemplate> 
                        <telerik:RadComboBox ID="RadComboBox2" AppendDataBoundItems="true" Height="200px" 
                            runat="server" Skin="WebBlue" DataTextField="Rolename" DataValueField="RoleID" 
                            DataSourceID="RCBaddnewrole" SelectedValue='<%# Bind("Rolename")%>'>  
                            <Items> 
                                <telerik:RadComboBoxItem Text="" Value="" /> 
                            </Items> 
                        </telerik:RadComboBox> 
                    </EditItemTemplate> 
                    <ItemTemplate> 
                        <%#Eval("Rolename")%> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
            </Columns> 
            <EditFormSettings ColumnNumber="3" CaptionFormatString="Edit details for User {0}" 
                CaptionDataField="RoleID">  
                <EditColumn UniqueName="EditCommandColumn1">  
                </EditColumn> 
                <FormTemplate> 
                    <asp:Table runat="server" ID="Table1" CellSpacing="1" CellPadding="1" Width="250" 
                        border="0">  
                        <asp:TableRow> 
                            <asp:TableCell ID="RCB2">  
                                <telerik:RadComboBox ID="RadComboBox2" runat="server" DataSourceID="RCBaddnewrole" 
                                    DataTextField="Rolename" DataValueField="RoleID">  
                                </telerik:RadComboBox> 
                            </asp:TableCell> 
                        </asp:TableRow> 
                        <asp:TableRow> 
                            <asp:TableCell> 
                                <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' 
                                    runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>  
                                </asp:Button>&nbsp;  
                                <asp:Button CausesValidation="false" ID="btnEdit" Text="EditRole" runat="server" 
                                    CommandName="EditRole"></asp:Button> 
                                <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" 
                                    CommandName="Cancel"></asp:Button></td>  
                            </asp:TableCell> 
                        </asp:TableRow> 
                    </asp:Table> 
                </FormTemplate> 
            </EditFormSettings> 
            <NoRecordsTemplate> 
                No Records  
            </NoRecordsTemplate> 
        </MasterTableView> 
    </telerik:RadGrid> 
    <asp:SqlDataSource ID="RCBaddnewrole" runat="server" ConnectionString="<%$ ConnectionStrings:LawsonSecurityConnectionString %>" 
        SelectCommand="SELECT [Rolename], [RoleID] FROM [Roles] ORDER BY [Rolename]">  
    </asp:SqlDataSource> 

Trying to access the RadComboBox item within the add new to use the selectedvalue to nisert into the SQL table.

I've hitting my head trying to access it through different ways but have no idea.

Is there a way if you add certain controls to different areas of a radgrid you can do a reverse look up on the item and know it's location within the radgrid? 

Thanks again you guys are awesome.
Jon-Jon Kershaw
Top achievements
Rank 2
 answered on 20 Aug 2009
0 answers
197 views
Hi,

Q2.2009.
I have problems to fire my RadTimePicker and returning the value in the Box. After each selected item over highlighted item (<a>) my page scroll and no time is returned in the box. I have tested many configurations and templates and have this problem every time. I need to select the items between the highlighted item and the small border ( left or right borders). In this case the item fire and return the value but is not possible to work in this case because i need to push between 2 or 3px in borders to fire. Could you suggest some solution please.

regards Romi.

<div class="boxLunVen"
                <div class="boton1"><img  alt='' src="../VistaStatic/images/Submenu/configurador1/semana.png" /></div
                <div class="time"
                <telerik:RadTimePicker ID="RadTimeInLunVen" runat="server" style="vertical-align:middle;" Width="60px" 
                         StartTime="13:0:0" EndTime="22:31:00" Interval="0:30:0" Columns="2" TimeFormat="HH:mm" Culture="es-ES"    
                         DateFormat="HH:mm" OnClientTimeSelected="OnTimeSelectedSem">      
                </telerik:RadTimePicker> 
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*" ControlToValidate="RadTimeInLunVen" ValidationGroup="group1"></asp:RequiredFieldValidator> 
                </div> 
                <div class="clear"></div>  
                
            </div> 
            <div class="boxSamedi"
                <div class="boton1"><img  alt='' src="../VistaStatic/images/Submenu/configurador1/weekend.png" /></div
                <div class="time"
                <telerik:RadTimePicker ID="RadTimeInSamedi" runat="server" style="vertical-align:middle;" Width="60px"
                        <ClientEvents OnPopupClosing="OnPopupClosing" /> 
                        <TimeView StartTime="13:0:0" EndTime="22:31:00" Interval="0:30:0" Columns="2" TimeFormat="HH:mm" Culture="en-US" OnClientTimeSelected="OnTimeSelected" runat="server">  
                        </TimeView> 
                        <DateInput DateFormat="HH:mm" Culture="en-US" runat="server"></DateInput>    
                </telerik:RadTimePicker> 
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*" ControlToValidate="RadTimeInSamedi" ValidationGroup="group1"></asp:RequiredFieldValidator> 
           
                </div> 
                <div class="clear"></div>  
                 
            </div> 

Regards
Pierre
Top achievements
Rank 1
 asked on 20 Aug 2009
1 answer
424 views
How can I set a rad grid to have all it's hierarchal dataviews shown/expanded all the time? I know you can do one row with the expanded attribute, but it seems looping through them and expanding all doesn't work as expected. IS there a property or place in the page lifecycle where I could put the loop? I basically want all data in the grid shown all the time.

Thanks.
Daniel
Telerik team
 answered on 20 Aug 2009
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?