Hi
I'm trying to change the caption/text on a GridButtonColumn, by code.
What i want is that the text on the PushButton is dependent on the value of a field.
The result is that I don’t see the push button, but only a text.
Can anybody tell me what I do wrong?
Thanks
Erik
| <telerik:GridButtonColumn ButtonType="PushButton" text="Create" |
| UniqueName="versionFunction" HeaderText="Function"> |
| <HeaderStyle Width="100px"></HeaderStyle> |
| </telerik:GridButtonColumn> |
| protected void Grid_Versioner_ItemDataBound(object sender, GridItemEventArgs e) |
| { |
| if (e.Item is GridDataItem) |
| { |
| GridDataItem dataItem = (GridDataItem)e.Item; |
| switch (dataItem["Status"].Text) |
| { |
| case "Created": |
| dataItem["versionFunction"].Text = "Execute"; |
| break; |
| case "Executing": |
| dataItem["versionFunction"].Text = "Executeing"; |
| break; |
| } |
| } |
| } |
| <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> |
| <script type="text/javascript"> |
| function changeEndDate(sender, e) { |
| //if start date changes change end date to be greater than start |
| var endDatePicker = $find("<%= EndDate.ClientID %>"); |
| if ( sender.get_selectedDate() > endDatePicker.get_selectedDate()) { |
| endDatePicker.set_selectedDate(sender.get_selectedDate()); |
| } |
| } |
| </script> |
| </telerik:RadScriptBlock> |
Hi, I placed a combobox as below , with auto complete feature and load on demand.
<
telerik:RadComboBox ID="radCboCity" runat="server" Width="175px" Height="150px" AllowCustomText=true EnableLoadOnDemand="True" ShowMoreResultsBox="true" EnableVirtualScrolling="true" OnItemsRequested="radCboCity_ItemsRequested"></telerik:RadComboBox>
I redirect to this form with querystring parameters which should populate the criteria on this form. I am setting the combobox value from server side something like : radCboCity.value= sCity;
well, I have some clientside validations and ajax postbacks on load of this form and the combo value returns 'undefined'. I am accessing the combo value from an external javascript file using the standard document object : document.getElementById("radCboCity").value
If I repost this form it returns a valid value.
Why is this behaviour? Am I missing mosthing?
thanks
| <telerik:RadGrid ID="grdWarranty" runat="server" AllowPaging="True" AllowSorting="True" |
| AutoGenerateColumns="False" GridLines="None" Skin="Default" Width="700px" PageSize="7" |
| OnNeedDataSource="grdWarranty_NeedDataSource" OnItemCommand="grdWarranty_ItemCommand" |
| OnItemCreated="grdWarranty_ItemCreated" ShowStatusBar="true"> |
| <MasterTableView Width="100%" UseAllDataFields="True" TableLayout="Fixed" DataKeyNames="CompanyID,LocationID,ObjectType,ObjectID"> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px" /> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px" /> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridTemplateColumn HeaderText="Name" DataField="ObjectName" SortExpression="ObjectName"> |
| <ItemTemplate> |
| <asp:LinkButton ID="LinkButtonOpen" runat="server" CausesValidation="False" CommandName='<%# DataBinder.Eval(Container, "DataItem.ObjectType") %>' |
| CommandArgument='<%# DataBinder.Eval(Container, "DataItem.ObjectID") %>' Text='<%# DataBinder.Eval(Container, "DataItem.ObjectName") %>' /> |
| <asp:Label runat="server" ID="lblName" Visible="false" Text='<%# DataBinder.Eval(Container, "DataItem.ObjectName") %>'></asp:Label> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridBoundColumn HeaderText="Type" DataField="ObjectType"> |
| </telerik:GridBoundColumn> |
| <telerik:GridTemplateColumn HeaderText="Location" DataField="LocationName" SortExpression="LocationName"> |
| <ItemTemplate> |
| <%# LocationDisp(DataBinder.Eval(Container, "DataItem.LocationName").ToString()) %> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Expires" DataField="ExpirationDateFormatted" SortExpression="ExpirationDate"> |
| <ItemTemplate> |
| <%# DateString.GetDateValue(DataBinder.Eval(Container, "DataItem.ExpirationDate").ToString()).ToString("M/d/yyyy").Replace("1/1/1900", "") %> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="# Days" DataField="ExpirationDays" SortExpression="ExpirationDate"> |
| <ItemTemplate> |
| <%# GetExpiration(DataBinder.Eval(Container, "DataItem.ExpirationDate").ToString()) %> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| </MasterTableView> |
| <PagerStyle AlwaysVisible="true" Mode="NumericPages" /> |
| <ClientSettings EnableAlternatingItems="true" EnableRowHoverStyle="true"> |
| <Scrolling AllowScroll="true" ScrollHeight="185px" UseStaticHeaders="true" /> |
| </ClientSettings> |
| </telerik:RadGrid> |

Note, that when the page index is changed, or a sorting has been done, the RadToolTipManager's TargetControls collection is cleared because the records on the new grid's page have the same ClientIDs as the old ones.
i did exactly as you mention in the example. but i am doing little bit change. in "UpdateToolTip" routine. i my case the behavior is little bit change. on Page 2 its showing the Page 1 tool tip. and On Page 3 its Showing Page 2 tool tip. when we comeback on previous page 2 its showing Page3 tooltip. :(
please if you can figureout this problem.
Private Sub UpdateToolTip(ByVal elementID As String, ByVal panel As UpdatePanel)
Dim ctrl As Control = Page.LoadControl("usercontrols/_attractions.ascx")
panel.ContentTemplateContainer.Controls.Add(ctrl)
Dim TempHotel As DataTable = ViewState("AttractionDetails")
Dim i As Integer
Dim TempTable As New DataTable
Dim DC As DataColumn
DC =
New DataColumn
DC.ColumnName =
"HotelCode"
DC.DataType = System.Type.GetType("System.String")
TempTable.Columns.Add(DC)
DC =
New DataColumn
DC.ColumnName =
"AttrName"
DC.DataType = System.Type.GetType(
"System.String")
TempTable.Columns.Add(DC)
DC =
New DataColumn
DC.ColumnName =
"Distance"
DC.DataType = System.Type.GetType(
"System.String")
TempTable.Columns.Add(DC)
Dim FindDR() As DataRow = TempHotel.Select("HotelCode='" & elementID & "'")
For i = 0 To FindDR.Length - 1
Dim DR As DataRow
DR = TempTable.NewRow
DR(0) = FindDR(i).Item(0)
DR(1) = FindDR(i).Item(1)
DR(2) = FindDR(i).Item(2)
TempTable.Rows.Add(DR)
Next
Application(
"TempData") = TempTable
End Sub
becuase my all data is coming from XML Source just for display. i am not fatching this data from the database.
One more thing i want to share not realated with this problem. i need to create a XMLNode like <c:condition> is it posible?
Regards