This is a migrated thread and some comments may be shown as answers.

Hello all.

2 Answers 22 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
shahid Aleem
Top achievements
Rank 1
shahid Aleem asked on 20 Jul 2010, 04:33 PM
Hello I want to show a popup on mouseover of each redgridcell. please tell me how to do this.

my scenario is some thing like this...

In my ascx file i have a radgrid
 
<telerik:RadGrid ID="gvDayWiseCashReport" runat="server" AutoGenerateColumns="False"
                GridLines="None" OnItemDataBound="gvDayWiseCashReport_ItemDataBound">
                <MasterTableView>
                    <RowIndicatorColumn>
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn>
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </ExpandCollapseColumn>
                </MasterTableView>
            </telerik:RadGrid>
In my code Behind on button click event i have written some code to populate radgrid

protected void btnSearch_Click(object sender, EventArgs e)
    {
        DaysList daysforList = null;
        Month = int.Parse(ddlMonth.SelectedValue);
        Year = int.Parse(ddlYear.SelectedValue);
 
        GetDates dates = new GetDates();
        FirstDate = dates.GetFirstDayOfMonth(Month, Year);
        LastDate = dates.GetLastDayOfMonth(Month, Year);
 
        days = System.DateTime.DaysInMonth(int.Parse(ddlYear.SelectedItem.Value), int.Parse(ddlMonth.SelectedValue)).ToString();
        int NoofDays = int.Parse(days);
 
        DataSet ds = new DataSet();
        DateTime date;
        CustomSQLCommand command = new CustomSQLCommand(@"select distinct Purpose,Others from tbl_CashRequest req left join tbl_CashPurpose purpose
        on purpose.ID=req.CashPurposeID", false);
        ds = command.ExecuteDataSet();
 
        gvDayWiseCashReport.DataSource = null;
        gvDayWiseCashReport.MasterTableView.Columns.Clear();
        gvDayWiseCashReport.DataBind();
 
        gvDayWiseCashReport.DataSource = ds;
 
        GridBoundColumn boundColumn;
        boundColumn = new GridBoundColumn();
        boundColumn.DataField = "Purpose";
        gvDayWiseCashReport.MasterTableView.Columns.Add(boundColumn);
 
 
        for (int i = 1; i <= NoofDays; i++)
        {
            date = dates.GetDate(int.Parse(ddlMonth.SelectedValue), int.Parse(ddlYear.SelectedItem.Value), i);
            string strDay = date.DayOfWeek.ToString();
            int Day = 0;
            CustomSQLCommand getDay = new CustomSQLCommand(@"select ID from tbl_PreferedTransferDay where PrefferedDay='" + @strDay + "'", false);
            try { Day = int.Parse(getDay.ExecuteScalar()); }
            catch { }
 
            if (Day != 0 && Day != null)
            {
                daysforList = new DaysList();
                GridBoundColumn boundColumn1;
                boundColumn1 = new GridBoundColumn();
 
                boundColumn1.HeaderText = String.Format("{0:ddd, MMM d, yyyy}", date);
                gvDayWiseCashReport.MasterTableView.Columns.Add(boundColumn1);
                daysforList.Day = date;
                daysforList.DayID = Day;
 
                ListDays.Add(daysforList);
            }
            Day = 0;
        }
 
        gvDayWiseCashReport.DataBind();
         
    }
then in my item databound i have logics in which i am add values to each cell of radgrid. Here when i have some value on cell i have some data to show when user mouseovers on a particular cell.
Here i have some code in my itemdatabound
 
for (int i = 0; i < ListDays.Count; i++)
            {
                for (int j = 0; j < detList.Count; j++)
                {
                    if (e.Item.ItemIndex == detList[j].ItemIndex && ((i + 3) == detList[j].CellNo))
                    {
                         
                        e.Item.Cells[i + 3].ToolTip = e.Item.Cells[i + 3].ToolTip + " Request Remarks: " + detList[j].Remarks + " Requester ID :" + detList[j].RequestID + " Requested Installment Amount :" + detList[j].Amount + "\r\n";
 
                        string val = e.Item.Cells[i + 3].ToolTip;
                                           }
                }
            }
 
I have logics in my itemdatabound which i have not given here.
 
in my item databound i am displaying with the using normal tooltip but if i want to do the same for a pop up or radtooltip, How can i do this? i dont want any more control in my radgrid and i have some repeated data for same cell so i have stored it in tooltip and used when repeated data  comes i have used the same tooltip and other value. please tell me how can i do this.

2 Answers, 1 is accepted

Sort by
0
Accepted
Sebastian
Telerik team
answered on 20 Jul 2010, 05:22 PM
Hello shahid,

You can use your current implementation and simply add RadToolTip manager on the page with AutoTooltipify set to true to transform the regular tooltips into RadToolTips.

The other options you have is to use template columns and bind the RadToolTips to them as illustrated on the demos below:

http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultcs.aspx?product=grid
http://demos.telerik.com/aspnet-ajax/tooltip/examples/bindtotarget/defaultcs.aspx

Best regards,
Sebastian
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
shahid Aleem
Top achievements
Rank 1
answered on 20 Jul 2010, 05:31 PM
Thansk Sebastian,

this is what i needed.
Tags
General Discussions
Asked by
shahid Aleem
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
shahid Aleem
Top achievements
Rank 1
Share this question
or