Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
198 views

I have a RadWindow that opens up containing another page from the site.

This page has a form on it with several standard asp.net / HTML input controls and a RadDatePicker.

On postback I validate the inputs. Several of the inputs get checked but only one of them is giving me an issue. The RadDatePicker.

For this example lets assume that a dropdown list does not have a selection, and the datepicker has an invalid date entered.

In either of these cases I construct and Alert() message that is shown to the user and some jQuery that will apply a special css style to show the inputs that have a problem.

The jQuery gets assembled during the validation like this.

 
// in the case that a contact has not been selected from the Contacts dropdown list
sJQuery += " $('#drpProspectContact').addClass('forminputerror'); ";
 
// In the case that the RadDatePicker date does not have a valid value in it.
sJQuery += " $('#dpForecastCloseDate_dateInput_text').addClass('forminputerror'); ";

Note: forminputerror puts a red line around the border and colors the background of the inputs.

The jQuery above has been tested with Firebug and works on both of the inputs in question.

At the end of the validation method I do this.

if (IsProspectError)
                {
                    String ErrorScript = "alert('" + sErrors + "'); " + sJQuery;
                    ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "", ErrorScript, true);
                    return false;
                }
                else
                {
                    return true;
 
                }

When the page is refreshed, an Alert box appears and I can see in the background that both of the inputs in question have the error style applied.

However, as soon as I hit the OK button on the alert box, the DatePicker reverts to a version with no error style applied. This happens before my eyes as the Red border etc is reverted back to the default state of the DatePicker

I have attached two images. One before the OK button is hit, and one after.

It's like the RadDatePicker is loaded after the rest of the page loads, or something, but that does not make sense either as the control is there to have a style applied while the alert box is showing. And the alert box is only there after postback.
How can closing the alert box remove a style from the RadDatePicker?

Finally I have tried RegisterStartupScript() and RegisterClientScriptBlock(). Made no difference.


Iana Tsolova
Telerik team
 answered on 22 Sep 2011
1 answer
230 views
Hi,

I used the following example:

http://www.telerik.com/comhttp://www.telerik.com/community/forums/aspnet-ajax/grid/using-dynamicobject-as-a-datasource-or-expandoobject.aspx#1615190

which works fine but I have problems grouping.
When I try to group by one of the columns I get the following Server exception:
at Telerik.Web.UI.GridDataSetHelper.CreateGroupByTable(DataTable SourceTable, GridTableView view)
at Telerik.Web.UI.GridDataSetHelper.CalcGroupByTables(GridTableView gridTableView, DataTable SourceTable, String RowFilter, Int32 FirstIndex, Int32 LastIndex, Boolean applyPaging, Boolean isCustomPaging)
at Telerik.Web.UI.GridEnumerableFromDataView.PerformTransformation()
at Telerik.Web.UI.GridEnumerableFromDataView.TransformEnumerable()
at Telerik.Web.UI.GridTableView.GetEnumerator(Boolean useDataSource, GridEnumerableBase resolvedDataSource, ArrayList dataKeysArray)
at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource)
at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource)
at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data)
at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data)
at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
at Telerik.Web.UI.GridTableView.PerformSelect()
at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
at Telerik.Web.UI.GridTableView.DataBind()
at Telerik.Web.UI.GridTableView.BindAllInHierarchyLevel()
at Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


or on Client side:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Field FirstName not found in the source table. Please check the expression syntax.

<telerik:RadGrid ID="RadGrid2" runat="server" PageSize="10" AllowSorting="True" AllowMultiRowSelection="True"
		AllowPaging="True" AllowCustomPaging="false" ShowGroupPanel="True" AutoGenerateColumns="false"
		GridLines="none">
		<PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
		<ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
			<Selecting AllowRowSelect="True"></Selecting>
			<Resizing AllowRowResize="false" AllowColumnResize="True" EnableRealTimeResize="True"
				ResizeGridOnColumnResize="False"></Resizing>
		</ClientSettings>
		<GroupingSettings ShowUnGroupButton="true" />
		<MasterTableView Width="100%">
			<Columns>
				<telerik:GridTemplateColumn HeaderText="First name" DataField="LastName" SortExpression="LastName"
					GroupByExpression="FirstName group by FirstName">
					<ItemTemplate>
						<%# (Container.DataItem as dynamic).FirstName%>
					</ItemTemplate>
					<EditItemTemplate>
						<asp:TextBox runat="server" ID="FirstNameTextbox" Text=<%# (Container.DataItem as dynamic).FirstName%> "> </asp:TextBox>
					</EditItemTemplate>
				</telerik:GridTemplateColumn>
				<telerik:GridTemplateColumn HeaderText="Last name" DataField="LastName" SortExpression="LastName"
					GroupByExpression="LastName group by LastName">
					<ItemTemplate>
						<%# (Container.DataItem as dynamic).LastName%>
					</ItemTemplate>
					<EditItemTemplate>
						<asp:TextBox runat="server" ID="LastNameTextbox" Text=<%# (Container.DataItem as dynamic).LastName%> "> </asp:TextBox>
					</EditItemTemplate>
				</telerik:GridTemplateColumn>
			</Columns>
		</MasterTableView>
	</telerik:RadGrid>
Radoslav
Telerik team
 answered on 22 Sep 2011
1 answer
85 views
I am working with a grid like in your demo at http://demos.telerik.com/aspnet-ajax/grid/examples/programming/commanditem/defaultcs.aspx.  The main difference is that mine is showing the MasterTableView on the top and bottom of the grid using <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="TopAndBottom" AlwaysVisible="True" />.

I want to do something like change the visible state of a button in the MasterTableView.  Think of changing the "First Page" button to "Visible=false" if you are on the first page.  I can find and change the control at the top just fine, but I can not seem to change the state of the controls in the footer.  Even if I recurse through the RadGrid Controls, I find the top panel twice, but never the bottom one.  If I search for the <div> id name, I can not seem to find it.

Oh, yes the other constraint is that for what I am trying to do, I need to change it from the "RadGridX_SelectedIndexChanged so I can not just put it into the databind for the control.

How do I access the footer controls?
Princy
Top achievements
Rank 2
 answered on 22 Sep 2011
0 answers
149 views
Hi

I use a radgrid on a search page to list search results in a paged manner. If a result-set returns more that 1 page of data and a user navigates to the last page all subsequent attempts to search result in no data displayed on the grid. This is despite that fact that on the quick-watch window the data is clearly there. The behaviour is the same regardless of whether simple or advanced data-binding is used. I have also tried to disable Viewstate and ViewstateMode to resolve this issue to no avail. Please see the grid client code below.

<telerik:RadGrid id="gvSearchDetails" runat="server" autogeneratecolumns="false" 
                        allowfilteringbycolumn="true" allowpaging="true" allowsorting="true"  ViewStateMode="Disabled"
                        allowmultirowselection="false" PageSize="10" onneeddatasource="gvSearchDetails_NeedDataSource" onitemdatabound="gvSearchDetails_ItemDataBound" EnableViewState="False">
                    <MasterTableView DataKeyNames="ReferenceNumber">
                        <Columns>
                            <telerik:GridTemplateColumn DataField="ReferenceNumber" headertext="Ref #" headerstyle-font-bold="true" UniqueName="clSensAnnouncementReference">
                                <ItemTemplate>
                                    <asp:LinkButton id="lnkReferenceNumber" runat="server" readonly="false" guid='<%# Eval("AnnouncementID") %>' text='<%# Eval("ReferenceNumber") %>' OnClick="lnkReferenceNumber_Click"></asp:LinkButton>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn UniqueName="clIssuer" DataField="Issuer" HeaderText="Issuer"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="clIssuerRole" DataField="IssuerRole" HeaderText="Issuer Role"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="clExchange" DataField="ExchangeName" HeaderText="Exchange"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="clSubmitter" DataField="SubmitterCompany" HeaderText="Submitter"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="clSubmissionDate" DataField="SubmissionDate" HeaderText="Submission Date"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="clDisseminationDate" DataField="DisseminationDate" HeaderText="Dissemintation Date"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="clFlashHeadline" DataField="FlashHeadlineText" HeaderText="Flash Headline"></telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
Masande Dyasi
Top achievements
Rank 1
 asked on 22 Sep 2011
1 answer
164 views
Has anybody been able to extract images from the new office 2010 themes as in the example below.

Many thanks
James
// Works
<img src='<%= Page.ClientScript.GetWebResourceUrl(grid.GetType(), "Telerik.Web.UI.Skins.Black.Grid.AddRecord.gif") %>' />
 
// Doesn't work
<img src='<%= Page.ClientScript.GetWebResourceUrl(grid.GetType(), "Telerik.Web.UI.Skins.Office2010Black.Grid.AddRecord.gif") %>' />


Iana Tsolova
Telerik team
 answered on 22 Sep 2011
3 answers
81 views
Hello,

I have two drag and drop grids and i would like to export all the shipped orders to an excel file. How could i make this?

Thank you very much.

Daniel
Telerik team
 answered on 22 Sep 2011
2 answers
175 views
Hi.
using ASP.NET MVC here, and using the Telerik Grid control.
I ran into a problem where, the initial databinding is fine from the server end, which contains a timespan object. it shows the value just fine.

However, when you press the refresh button on the Grid, the data just disappears even though, the AJAX select call IS being called.

I then ran into this thread:

http://www.telerik.com/community/forums/preview-thread/aspnet-ajax/grid/timespan-object-with-mvc-grid.aspx

So I implemented the Client Template and that works. The problem now is that when you hit the refresh button - I see the icon just indicating its doing work but there is no work being done at all! No errors either.

so what can I do here to display the TimeSpan object correctly on client side, with these issues even when you hit the refresh button?



Ahmed Ilyas
Top achievements
Rank 1
 answered on 22 Sep 2011
1 answer
124 views
Hi all :)


how can I get the first index or specified index of a rad list box ?


for example:


I want to put the value of a the first or second index as a text in a textbox


how can I do that ?


thank you all :)
Shinu
Top achievements
Rank 2
 answered on 22 Sep 2011
1 answer
115 views
I have a grid with a parent/detail table. Clicking on the expand/collaps icon displays/hides the detail column. Everything works fine except, clicking on the parent table row "Selects" it and this is undesirable behavior in my scenario since selecting the row doesn't do anything and isn't used. I tried setting the "Selecting" clientSettings Parameter AllowRowSelect='False", and this prevented the row being selected, however, this also prevents the expand/collapse column from working to display the detail table. Apparently you need to be able to select the parent row to display the child table. Is there a way to prevent the selection of the parent row and still have the expand/collapse column work? If not, is there a way of preventing the selected parent row from being shown as "highlighted". The visual appearance is all I really care about.
Princy
Top achievements
Rank 2
 answered on 22 Sep 2011
46 answers
2.4K+ views
Hi,

I want to evaluate the radScheduler component. I have dowloanded the latest version of Prometheus.

I only put a on a radScheduler component on a form with a datasource but at exection I obtain the following popup message :

'Telerik' is undefined

The code generated is  :

...

</
div><div class="rsFooter">

<a class="rsFullTime" href="#">Show 24 hours...</a>

</div><script type="text/javascript">

Telerik.Web.UI.RadScheduler.FixHeight("RadScheduler1");

<


PS : My global settings for my machine are "French".

Best regards,

Vina
Top achievements
Rank 1
 answered on 22 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?