Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
257 views
Hello all,

I'm currently having an issue with the RadToolTip flickering on postback. It may just be a mis-use of the intended purpose, but im hoping there may be something I can do.

I like the way the modal works (disabling most of the page and displaying the contents of the tooltip), this is the biggest reason I chose this (perhaps the window tool has something in the same range, I havent looked just yet).

I have searched and found that the tooltip disposes on postback, however the post states one option is to make an ajax request instead of a full postback. I thought the RadAjaxManager would handle that, it partially does, but it still flickers.
Source: http://www.telerik.com/community/forums/aspnet-ajax/tooltip/modal-radtooltip-not-displayed-after-postback.aspx

SCENARIO:
I am creating a user management system. The main page contains search criteria and a result grid. There is a linkbutton used to add a new user. I have a user control that does the adding of the user, and I am attempting to put it in the RadToolTip modal that pops up when the 'add user' link button is clicked. There is server-side functionality on the user control.

Everything seems to work fine, however the modal popup seems to dissapear and come back after every postback (any server-side event inside of the user control).

I have set the tooltips ShowEvent and HideEvent as 'FromCode' and Modal to 'True'. On the 'add user' link button click event, I set the VisibleOnPageLoad property to 'true' and .Show() it to the page. The reason I do the VisibleOnPageLoad property on the event, is so that it doesnt automatically pop-up when the main page loads. I am also using the RadAjaxManager to set ajax on the tooltip on the click event of the link button.

Everything is working perfectly and beatifully, excluding the pop-up clearing and coming back when events are fired from the user control within the tooltip.

Am I missing something that could help me, or mis-using the tooltip? Perhaps my logic is incorrect... Any help is appreciated.

RadAjaxManager Settings On User Management Page
<telerik:RadAjaxManager ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="SearchUsersLinkButton">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="UserSearchResultsRadGrid" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="AddNewUserLinkButton">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="AddEditUserRadToolTip" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

Tooltip Code on User Management Page
<telerik:RadToolTip ID="AddEditUserRadToolTip" Modal="true" Skin="Vista" ShowEvent="FromCode" Position="Center" RelativeTo="BrowserWindow" EnableShadow="true" HideEvent="FromCode" runat="server">
    <ACB:ProfileEdit ID="AddEditUserProfileEdit" runat="server" />
</telerik:RadToolTip>

AddNewUserLinkButton_Click Event
protected void AddNewUserLinkButton_Click(object sender, EventArgs e)
{
    AddEditUserProfileEdit.InitializeData(null);
    AddEditUserRadToolTip.VisibleOnPageLoad = true;
    AddEditUserRadToolTip.Show();
}

AddEditUserProfileEdit InitializeData(int? personID) Method and Methods called within (Just in case)
public void InitializeData(int? personID)
{
    if (personID == null)
    {
        //--New User Setup
        SetupCreateUser();
    }
}
private void ClearForm()
{
    ProfileFormInfoLabel.Text = " ";
    this.FirstName = String.Empty;
    this.LastName = String.Empty;
    this.UserNamePrimaryEmail = String.Empty;
    this.AlternateEmail = String.Empty;
    this.PhoneNumber = String.Empty;
    this.UserPassword = String.Empty;
}
private void SetupCreateUser()
{
    //--Title
    ProfileFormTitleLabel.Text = "Add System User";
    //--FormType
    this.FormType = FormTypeEnum.Create;
    //--Roles RadGrid
    UserRolesRadGrid.DataSource = new DataTable();
    UserRolesRadGrid.DataBind();
    ClearForm();
}
Esteban
Top achievements
Rank 1
 answered on 14 Mar 2011
3 answers
92 views
Hi,

How can I make css class of time slots in Radscheduler persist after postback. I am giving a colorful background to special days and times and I loose them after postback.

 protected void rsTicketsSchedule_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
    {
   
        if ( condition1)
              e.TimeSlot.CssClass = "Disabled";
       if ( condition2)
           e.TimeSlot.CssClass = "enabled";
}

To get the styles back, I have to rebind scheduler with every postback from the page. It affecting the performance of my application,  I want to avoid this and make cssclass persist.

Thanks,
Prava
Veronica
Telerik team
 answered on 14 Mar 2011
4 answers
235 views
Is it possible to get the expandable arrows to appear on the left side of the text in my panelbar items?  I have been trying to figure this out to no avail.  Any help would be greatly appreciated.  Thank you.
Srinivas
Top achievements
Rank 1
 answered on 14 Mar 2011
4 answers
98 views
Hi!

I have a RadGrid with 6 columns.
Filter is enabled on all columns.

In my first column, I have used a FilterTemplate to display a DropDown containing all my product categories.

Some of the categories have the same name, but different id's.
When I select a category from the dropdown, a client filtering is performed on the category name.
Now the grid contains all products where the category name is equal to the name in the drop down.

I want the filtering to occure on the value of the dropdown and not the name.
I tried to add a BoundColumn containing the CategoryId and filter on that column. This works fine when the column is visible, but when I set it to Display="false", no filtering occurs.

Any suggestions?

Regards
Per
Per
Top achievements
Rank 1
 answered on 14 Mar 2011
1 answer
53 views
Hi,

Does RadEditor work with .Net Framework 2.0 or it only works with 3.5 and 4.0?

Regards,
Tim
Neil
Top achievements
Rank 1
 answered on 14 Mar 2011
2 answers
149 views
I have a need to extend the radListBox control to add some custom paging and filtering to it to improve performance (I am potentially loading several thousand rows into the list).  I've tried creating a custom control based on the radListBox but have run into various issues.

Can someone point me to a good example of extending the radListBox control or a control that is similar to it?  I've looked with not much luck.
Trent Ballew
Top achievements
Rank 1
 answered on 14 Mar 2011
3 answers
113 views
Hi,

I am creating a Grid in code behind which has all cells set to edit option and the save is on the save command.

My Grid is coded as such

<telerik:RadGrid ID="RadGrid1" OnPreRender="RadGrid1_PreRender" OnDataBinding="RadGrid1_DataBinding"
    OnNeedDataSource="RadGrid1_NeedDataSource" OnItemCommand="RadGrid1_ItemCommand"
    Skin="Web20" runat="server" GridLines="None" OnItemCreated="RadGrid1_ItemCreated"
    style="top: 190px; left: 10px; position: absolute;" width="750px" Height="280px" >
    <MasterTableView EditMode="InPlace" CommandItemDisplay="Top" DataKeyNames="ID" AutoGenerateColumns="true" ShowFooter="True">
        <CommandItemTemplate>
        <div style="padding: 5px 5px;">
            <asp:LinkButton ID="btnAddNew" runat="server" CommandName="AddNewRow">
                <img style="border:0px;vertical-align:middle;" alt="" src="Images/AddRecord.gif" />
                Add New Row
                </asp:LinkButton>  
            <asp:LinkButton ID="btnSave" runat="server" CommandName="Save">
                <img style="border:0px;vertical-align:middle;" alt="" src="Images/save.png" />
                Save in Database
                </asp:LinkButton>  
        </div>
        </CommandItemTemplate>
    </MasterTableView>
    <ClientSettings>
        <Scrolling AllowScroll="true" ScrollHeight="230" UseStaticHeaders="true" />
    </ClientSettings>
</telerik:RadGrid>


And in the Code Behind

protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
    {
        saveDataInDataTable();
        switch (e.CommandName)
        {
            case "InsertNewRow":
                {
                    AddNewRowInDataTable();
                    //saveDataInDataTable();
                    string script = "setTimeout( function () { selectedCellId='" + e.CommandArgument.ToString() + "'; MoveDown();},100);";
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "selectCell", script, true);
                    ViewState["inserted"] = true;
 
                }
                break;
            case "AddNewRow":
                {
                    AddNewRowInDataTable();
                    //saveDataInDataTable();
                }
                break;
            case "Save":
                {
                    //saveDataInDataTable();
                    //UpdateDatabase();
                    //Session["key"] = 0;
                    //RadAjaxManager1.Alert("The database was successfully updated");
                }
                break;
            default: break;
        }
    }
 
    // Add new empty row into DataTable
    private void AddNewRowInDataTable()
    {
        NewRowsCount++;
        DataRow row = GridSource.NewRow();
        row["ChequeID"] = txtChequeID.Text;       
        row["AccountNo"] = "";
        row["AccountName"] = "";
        row["Amount"] = 0;
        row["VAT"] = "S";
        row["VATAmount"] = 0;
        GridSource.Rows.Add(row);
        RadGrid1.Rebind();
    }
 
protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            TextBox Amount = (e.Item as GridEditableItem)["Amount"].Controls[0] as TextBox;
            Amount.AutoPostBack = true;
            Amount.TextChanged += new System.EventHandler(this.Amount_TextChanged);
            string eventHandler = string.Format("gridTextBoxOnFocus('{0}');", Amount.ClientID);
            Amount.Attributes.Add("onFocus", eventHandler);
 
            TextBox AccountNo = (e.Item as GridEditableItem)["AccountNo"].Controls[0] as TextBox;
            AccountNo.AutoPostBack = true;
            AccountNo.TextChanged += new System.EventHandler(this.AccountNo_TextChanged);
        }
    }
 
protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
        RadGrid1.Attributes.Add("onkeydown", "onKeyDown(this,event);");
        int itemsCount = 0;
        int columnsCount = 0;
        StringBuilder builder = new StringBuilder();
        // Attach the event handlers to the client side events of the TextBoxes.
        foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
        {
            if (item is GridDataItem)
            {
                columnsCount = 0;
                for (int i = 2; i < RadGrid1.MasterTableView.RenderColumns.Length; i++)
                {
                    GridColumn column = RadGrid1.MasterTableView.RenderColumns[i];
                    TextBox textBox = (item[column.UniqueName].Controls[0]) as TextBox;
                    if (textBox != null)
                    {
                        textBox.Attributes.Add("ondblclick", "cellDoubleClickFunction('" + textBox.ClientID + "');");
                        textBox.Attributes.Add("onclick", "cellClick('" + textBox.ClientID + "');");
                    }
                    if ((i == 2) || (i == 3) || (i == 4))
                    {
                        textBox.ReadOnly = true;
                        textBox.Attributes.Add("class", "readOnly");
                    }
                    columnsCount++;
                }
                itemsCount++;
            }
        }
 
        if (RadGrid1.MasterTableView.Items.Count > 0)
        {
            RadGrid1.MasterTableView.GetColumn("ID").Visible = false;
            RadGrid1.MasterTableView.GetColumn("ChequeID").Visible = false;
            RadGrid1.MasterTableView.GetColumn("CustomerID").Visible = false;
        }
       RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "init", "colls = " + columnsCount + ";rows=" + itemsCount + ";", true);
    }

What I want to do is have on of the columns in the grid be a radcombobox rather than a simple textbox.

I already have a combo box on the page outside the grid and would like the same combobox (it can be a duplicate of the original one) in each grid row.

The reason I am creating the grid as such is because the user wants all the grid rows to be in edit mode so they dont have to click edit and save for each row, rather they change all the rows or add new ones and click save once.

My radcombox box already on the page is:

<telerik:RadComboBox ID="drpParentAccount" runat="server" Height="200px" Width="240px"
                                    Filter="Contains" EmptyMessage="Choose Parent Account" MarkFirstMatch="true" ChangeTextOnKeyBoardNavigation="false"
                                    DataTextField="Account" DataValueField="Account" OnItemDataBound="RadComboBoxParentAccount_ItemDataBound"
                                    EnableLoadOnDemand="true" OnItemsRequested="RadComboBoxProduct_ItemsRequested"
                                    AutoPostBack="true" DataSourceID="SqlDataSourceParentAccount"
                                    style="top: 10px; left: 550px; position: absolute;">
 
                                    <HeaderTemplate>
                                        <table style="width: 240px" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td style="width: 60px;">
                                                    Number</td>
                                                <td style="width: 180px;">
                                                    Namer</td>
                                            </tr>
                                        </table>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <table style="width: 240px" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td style="width: 60px;">
                                                    <%# DataBinder.Eval(Container.DataItem, "Account") %>
                                                </td>
                                                <td style="width: 180px;">
                                                    <%# DataBinder.Eval(Container.DataItem, "AccountName") %>
                                                </td>
                                            </tr>
                                        </table>
                                    </ItemTemplate>
                                     
                                </telerik:RadComboBox>

I already have columns selected for Account and AccountName as textboxes in the Grid. But I want the Account column to be a dropdown similar to above.

Any help on how to get that going using PreRender.

Thanks,

Ads
Vasil
Telerik team
 answered on 14 Mar 2011
5 answers
391 views
Hi,

How to save image into database on button click using RadAysncUpload control.

Please Help!

Regards
Ravi
Dimitar Terziev
Telerik team
 answered on 14 Mar 2011
5 answers
86 views
Hi, I am using various telerik components which are working fine. If the server goes down and someone still has the web application open and they click on something that will cause a callback, you will get the following error

Data not loaded: Object doesn't support this property or method

this is easy to trap in Firefox (using window.onerror) but it does not work in IE, whats the best way of dealing with this as "Data not loaded: Object doesn't support this property or method" does not mean anything to an end user.

thanks
Maria Ilieva
Telerik team
 answered on 14 Mar 2011
2 answers
87 views
Hi,

I have a heirarchy grid. But I am having a problem with it.

The detail row is showing all the records from the table rather than just the ones which match the parent row.

My Grid Code is:

    <telerik:RadGrid ID="RadGrid1" DataSourceID="SessionDataSource1" runat="server" ShowStatusBar="false"
    AutoGenerateColumns="False" AllowSorting="True" AllowMultiRowSelection="False"
    AllowPaging="False" GridLines="None" ShowFooter="False" Skin="Web20"
    style="top: 5px; left: 5px; position: absolute;" Width="780px" Height="470px">
    <PagerStyle Mode="NumericPages"></PagerStyle>
    <MasterTableView DataSourceID="SessionDataSource1" DataKeyNames="TOPID" AllowMultiColumnSorting="True"
        Width="100%" CommandItemDisplay="None" Name="Customers" HierarchyDefaultExpanded="true">
        <DetailTables>
            <telerik:GridTableView DataKeyNames="BOTID" DataSourceID="SessionDataSource2" Width="100%"
                runat="server" CommandItemDisplay="None" Name="Orders">
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="BOTID" MasterKeyField="TOPID" />
                </ParentTableRelation>                      
                <Columns>
                    <telerik:GridBoundColumn SortExpression="BOTID" HeaderText="JournalID" HeaderButtonType="TextButton"
                        DataField="BOTID" UniqueName="BOTID" Visible="true">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Account" HeaderText="Account" HeaderButtonType="TextButton"
                        DataField="Account" UniqueName="Account">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="AccountName" HeaderText="Account Name" HeaderButtonType="TextButton"
                        DataField="AccountName" UniqueName="AccountName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Debit" HeaderText="Debit" HeaderButtonType="TextButton"
                        DataField="Debit" UniqueName="Debit">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Credit" HeaderText="Credit" HeaderButtonType="TextButton"
                        DataField="Credit" UniqueName="Credit">
                    </telerik:GridBoundColumn>                          
                </Columns>
                <SortExpressions>
                    <telerik:GridSortExpression FieldName="Account"></telerik:GridSortExpression>
                </SortExpressions>                       
            </telerik:GridTableView>
        </DetailTables>
        <Columns>
             
            <telerik:GridBoundColumn SortExpression="Date" HeaderText="Date" HeaderButtonType="TextButton"
                DataField="Date" UniqueName="Date">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn SortExpression="TOPID" HeaderText="JournalID" HeaderButtonType="TextButton"
                DataField="TOPID" UniqueName="TOPID" Visible="true">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn SortExpression="JournalTitle" HeaderText="Title" HeaderButtonType="TextButton"
                DataField="JournalTitle" UniqueName="JournalTitle">
            </telerik:GridBoundColumn>           
        </Columns>
        <SortExpressions>
            <telerik:GridSortExpression FieldName="Date"></telerik:GridSortExpression>
        </SortExpressions>
    </MasterTableView>
</telerik:RadGrid>
<asp:SqlDataSource ID="SessionDataSource1" ConnectionString="<%$ ConnectionStrings:SASConnectionString %>"
    ProviderName="System.Data.SqlClient" runat="server"
    SelectCommand="Select DISTINCT JournalID AS TOPID, Convert(char(10),CreationDate,103) AS [Date], JournalTitle from Journal
                        Where (JournalID Like @drpJournal) AND (Journal.CreationDate >= @DateFrom) AND (Journal.CreationDate <= @DateTo)"
    >
    <SelectParameters>
        <asp:ControlParameter ControlID="drpJournal" Name="drpJournal" PropertyName="SelectedValue" Type="String" />
        <asp:ControlParameter ControlID="RadDatePicker1" Name="DateFrom" PropertyName="SelectedDate" Type="DateTime" />
        <asp:ControlParameter ControlID="RadDatePicker2" Name="DateTo" PropertyName="SelectedDate" Type="DateTime" />
    </SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SessionDataSource2" ConnectionString="<%$ ConnectionStrings:SASConnectionString %>"
    ProviderName="System.Data.SqlClient" runat="server"
    SelectCommand="Select JournalID AS BOTID, Journal.Account, AccountName, SUM(Debit) AS Debit, SUM(Credit) AS Credit from Journal JOIN Ledger ON Journal.Account = Ledger.Account
                        Where (JournalID Like @drpJournal) AND (Journal.CreationDate >= @DateFrom) AND (Journal.CreationDate <= @DateTo) GROUP BY JournalID, Journal.Account, AccountName"
     >
     <SelectParameters>
        <asp:ControlParameter ControlID="drpJournal" Name="drpJournal" PropertyName="SelectedValue" Type="String" />
        <asp:ControlParameter ControlID="RadDatePicker1" Name="DateFrom" PropertyName="SelectedDate" Type="DateTime" />
        <asp:ControlParameter ControlID="RadDatePicker2" Name="DateTo" PropertyName="SelectedDate" Type="DateTime" />
    </SelectParameters>
</asp:SqlDataSource>

The grid brings the 3 Parent record where the JournalID = 96, 99 and 100. But then under each of them it shows the records with all 3 JournalIDs, while it should only show the records with JournalID 96 under Parent 96 etc.

Any ideas how to resolve this.

Ads
Adeel
Top achievements
Rank 1
 answered on 14 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?