Hi Telerik support,
I am running Telerik: v2008.3.1214.35
I am having trouble with the radgrid and tooltipManager with paging.
The grid is dynamically loaded when a menu selection is made.
When I don’t have paging my tooltips behave properly. With paging they are display data from the first page only.
I have the tooltip and the grid defined in AJAX manager, because I am using paging I went from simple databinding to advanced. I know there is a sequence to the databinding when using advanced.
I know I am hitting the Itemdatabound event before the rebind… Could you please provide an example on how to resolve this.
Thank you
Julie
Code below:
The setting in Ajax manager.
<telerik:AjaxSetting AjaxControlID="gridStudyDetails">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="gridStudyDetails" LoadingPanelID="LoadingPanel1"/>
<telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:RadToolTipManager ID="RadToolTipManager1" runat="server"
RelativeTo="Element"
Width="420px"
Height="150px"
Position="BottomLeft"
HideEvent="ManualClose"
Title="Study Details"
Skin="Vista"
Animation="Slide"
ShowEvent="OnClick" AutoTooltipify="False"
onajaxupdate="RadToolTipManager1_AjaxUpdate" EnableViewState="True">
</telerik:RadToolTipManager>
The grid
<telerik:RadGrid ID="gridStudyDetails" runat="server" AutoGenerateColumns="False"
ClientSettings-Selecting-AllowRowSelect="true" CssClass="gridText"
skin="Vista" Width="675px" GridLines="None"
onitemcommand="gridStudyDetails_ItemCommand" AllowSorting="True"
onsortcommand="gridStudyDetails_SortCommand"
onitemdatabound="gridStudyDetails_ItemDataBound" AllowPaging="True"
onpageindexchanged="gridStudyDetails_PageIndexChanged" PageSize="6"
EnableViewState="False" onneeddatasource="gridStudyDetails_NeedDataSource" >
<HeaderContextMenu EnableTheming="True">
<CollapseAnimation Duration="200" Type="OutQuint" />
</HeaderContextMenu>
<ValidationSettings EnableValidation="False" />
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<ClientSettings enablepostbackonrowclick="True">
<Selecting AllowRowSelect="True" />
</ClientSettings><FilterMenu EnableTheming="True">
<CollapseAnimation Duration="200" Type="OutQuint" />
</FilterMenu>
<PagerStyle Position="TopAndBottom" EnableSEOPaging="True" />
<MasterTableView DataKeyNames="StudyID, ProtocolID" EnableViewState="True" CurrentResetPageIndexAction="SetPageIndexToFirst">
<Columns>
<telerik:GridBoundColumn DataField="StudyID" HeaderText="Study ID" UniqueName="StudyID" Visible="True" ReadOnly="true">
<HeaderStyle Width="65px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="RecType" HeaderText="RecType UniqueName="RecType" Visible="False" ReadOnly="true">
<HeaderStyle Width="65px" />
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn UniqueName="DetailStudy">
<ItemTemplate>
<asp:HyperLink ID="hlkStudyDetail" runat="server" NavigateUrl="#" Text="Details" ></asp:HyperLink>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
Code Behind:
protected void gridStudyDetails_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
{
Control hpStudyDetail = e.Item.FindControl("hlkStudyDetail");
if (!Object.Equals(hpStudyDetail, null))
{
if (!Object.Equals(this.RadToolTipManager1, null))
{
DataRowView currentRow = (DataRowView)e.Item.DataItem;
this.RadToolTipManager1.TargetControls.Add(hpStudyDetail.ClientID,currentRow.Row["StudyID"].ToString(), true);
}
}
}
}
protected void gridStudyDetails_PageIndexChanged(object source, GridPageChangedEventArgs e)
{
gridStudyDetails.DataSource = null;
RadToolTipManager1.TargetControls.Clear();
gridStudyDetails.Rebind();
}
protected void RadToolTipManager1_AjaxUpdate(object sender, ToolTipUpdateEventArgs e)
{
Control ctrl = Page.LoadControl("StudyDetail.ascx");
StudyDetail details = (StudyDetail)ctrl;
details.StrStudyID = e.Value;
e.UpdatePanel.ContentTemplateContainer.Controls.Add(ctrl);
}
protected void gridStudyDetails_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
if (Session["Selection"] != null)
{
string selection = Session["Selection"].ToString();
if (selection == "Pending" || selection == "Approved" || selection == "Archived")
{
SetMenu(selection);
}
else
{
gridStudyDetails.DataSource = null;
}
}
}
protected void SetMenu(string selection)
{
switch (selection)
{
case "Pending":
{
lblGridHeader.Text = "Pending Studies";
lblGridDetails.Text = "Studies";
gridStudyDetails.Columns.FindByUniqueName("ApprovalToDate").Display = false;
gridStudyDetails.Columns.FindByUniqueName("ReceiveDate").Display = true;
DataColumn dc0 = new DataColumn("DashBoardSelection");
dc0.DataType = typeof(string);
dc0.DefaultValue = selection;
gridDataTable.Columns.Add(dc0);
DataColumn dc1 = new DataColumn("DashBoardCategory");
dc1.DataType = typeof(string);
dc1.DefaultValue = "Studies";
gridDataTable.Columns.Add(dc1);
gridStudyDetails.DataSource = gridDataTable;
//gridStudyDetails.DataBind();
StudyPanel.CssClass = "";
break;
}
}
}
protected void MenuDashboard_ItemClick(object sender, Telerik.Web.UI.RadMenuEventArgs e)
{
Session["Selection"] = e.Item.Value;
if (e.Item.Value == "Pending" || e.Item.Value == "Approved" || e.Item.Value == "Archived")
{
gridStudyDetails.DataSource = null;
gridStudyDetails.Rebind();
}
else
{
SetMenu(e.Item.Value);
}
}
| public void InstantiateIn(Control container) |
| { |
| Panel pnl = new Panel(); |
| pnl.ID = "ElementContainerPnl"; |
| pnl.CssClass = "elementListItem"; |
| Label elementName = new Label(); |
| elementName.ID = "ElementName"; |
| elementName.DataBinding += new EventHandler(elementName_DataBinding); |
| RadToolTip toolTip = new RadToolTip(); |
| toolTip.ID = "ElementToolTip"; |
| toolTip.TargetControlID = elementName.ID; |
| Image img = new Image(); |
| img.ID = "ElementToolTipImage"; |
| img.DataBinding += new EventHandler(img_DataBinding); |
| Label toolTipText = new Label(); |
| toolTipText.ID = "ElementToolTipText"; |
| toolTipText.DataBinding += new EventHandler(toolTipText_DataBinding); |
| toolTip.Controls.Add(img); |
| toolTip.Controls.Add(toolTipText); |
| pnl.Controls.Add(elementName); |
| container.Controls.Add(pnl); |
| container.Controls.Add(toolTip); |
| } |
var
slide;
var expanded = false;
function SetUpAnimation(element) {
element.style.position =
"relative";
if(Telerik.Web.UI.AnimationSettings != null) {
var expandAnimation = new Telerik.Web.UI.AnimationSettings({});
var collapseAnimation = new Telerik.Web.UI.AnimationSettings({});
slide = new Telerik.Web.UI.Slide(element, expandAnimation, collapseAnimation, false);
slide.initialize();
slide.set_direction(Telerik.Web.UI.SlideDirection.Up);
}
}
function ExpandPendingDock(element) {
if(!expanded) {
element.parentNode.style.visibility =
"visible";
element.parentNode.style.display =
"block";
slide.expand();
expanded =
true;
}
}
function CollapsePendingDock(element) {
if(expanded) {
element.parentNode.style.visibility =
"visible";
element.parentNode.style.display =
"block";
slide.collapse();
expanded =
false;
}
}
Regards,
Venu
protected void rgdViStore_InsertCommand(object source, GridCommandEventArgs e)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
DataTable substanceTable = this.substanceSource;
storeData.VISTORE_V_EDIT_DISPLAYRow currentRow = (storeData.VISTORE_V_EDIT_DISPLAYRow)substanceTable.NewRow();
try
{
// start editing
currentRow.BeginEdit();
// shared code for insert and update, does not fire exception
// uses ExcractValues and gets the values from the template columns
persistChanges(editedItem, currentRow);
currentRow.EndEdit();
substanceTable.Rows.Add(currentRow);
this.substanceSource = (storeData.VISTORE_V_EDIT_DISPLAYDataTable)substanceTable;
rgdViStore.EditIndexes.Clear();
rgdViStore.Rebind();
}
catch (Exception ex)
{
currentRow.CancelEdit();
rgdViStore.EditIndexes.Clear();
rgdViStore.Rebind();
e.Canceled = true;
}
}
Hi,
Using the Day view of the RADScheduler I would liketo customize the in-line edit window. I would like to add the End-Time optionin the window itself without going to the ‘Option’ button. I would also like tocollect the appointment details from the server on the Appointment Insert Event.
Thanks
Sabrish