Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
121 views
I must be missing something...

<telerik:RadDateInput ID="txtBirthdate" runat="server" ValidationGroup="DemographicUpdate" SelectionOnFocus="SelectAll"   
DateFormat="d" DisplayDateFormat="d" /> 
 

But it won't accept the value of "12/19/1974". Can someone explain what I'm doing wrong?

Thanks!
Daniel
Telerik team
 answered on 13 Nov 2008
1 answer
98 views
Is it possible to change layout of the spell checking form if I for example want to use my own ImageButtons or change the text on the buttons?
Rumen
Telerik team
 answered on 13 Nov 2008
1 answer
172 views

One of our developers is experiencing a very odd behavior from RadGrid. The grid is returning zeros for "blank" textbox values when using ExtractValuesFromItem to populate a collection. We need it to return something recognizable (either blank or null) Has anyone seen this and figured out a workaround for it?

We are saving the grid's edited items (from a bulk edit grid) by iterating through the EditItems collection with the following code:

 

 

 

foreach (GridEditableItem editedItem in RGCounty.EditItems)

{

Hashtable newValues = new Hashtable();

//The GridTableView will fill the values from all editable columns in the hash

RGCounty.Items[editedItem.ItemIndex].OwnerTableView.ExtractValuesFromItem(newValues, editedItem);

 

 

string strUpdateCommand = "Update tblCountyData Set ";

foreach (string strField in newValues.Keys)

 {

 if (strField != strIDField)

 {

strUpdateCommand = strUpdateCommand + strField +

 

"= '" + newValues[strField] + "', ";

 }

}

 

 

//Remove last ,

 

strUpdateCommand = strUpdateCommand.Remove(strUpdateCommand.Length - 2);

strUpdateCommand = strUpdateCommand +

 

" where id=" + newValues[strIDField];
}


And the ASPX looks like this:

<asp:SqlDataSource ID="SqlCounty" runat="server"

ConnectionString="<%$ ConnectionStrings:RdiSds %>"

 onselecting="SqlCounty_Selecting"

 DeleteCommand="DELETE FROM tblCountyData WHERE id = @id"

 SelectCommand="SELECT [id], [ReportPeriodID], [CountyName], [StateCode], CAST([EstimatedP6Population] AS Varchar) AS EstimatedP6Population, CAST([InTabSample] AS Varchar) AS InTabSample FROM [TblCountyData] WHERE ([ReportPeriodId] = @ReportPeriodId) order by IsNull(statecode, 'ZZ'), IsNull(countyname, 'ZZ')"

 ondeleting="SqlCounty_Deleting">

 <SelectParameters>

 <asp:Parameter Name="ReportPeriodID" Type="Int32" />

 </SelectParameters>

 <DeleteParameters>

 <asp:Parameter Name="id" Type="Int32"/>

 </DeleteParameters>

 </asp:SqlDataSource>

 

<telerik:RadScriptManager ID="CountyRadScriptManager" runat="server" OutputCompression="AutoDetect"></telerik:RadScriptManager>

 <br />

 <asp:Label ID="lblError" runat="server" Text="None" Visible="False" ForeColor="#CC3300"></asp:Label>

 <input id="EstimatedP6PopulationCheckBoxHid" type="hidden" runat="server" enableviewstate="true"/>

 <telerik:RadGrid ID="RGCounty" runat="server" DataSourceID="SqlCounty"

 GridLines="None" Skin="Office2007" AllowMultiRowEdit="True"

 AutoGenerateColumns="False" BorderStyle="None" onprerender="RGCounty_PreRender"

 ondatabound="RGCounty_DataBound" onitemdatabound="RGCounty_ItemDataBound" CellSpacing="0" CellPadding="0"

 ondeletecommand="RGCounty_DeleteCommand"><MasterTableView Name="t1" DataKeyNames="id" DataSourceID="SqlCounty" ShowFooter="true">

 <rowindicatorcolumn>

 <HeaderStyle Width="20px" />

 </rowindicatorcolumn>

 <expandcollapsecolumn>

 

 

<HeaderStyle Width="20px" />

 </expandcollapsecolumn>

 <Columns>

 <telerik:GridClientDeleteColumn ButtonType="PushButton"

 ConfirmText="Are you sure you want to delete the selected row?"

 HeaderStyle-Width="35px" ShowInEditForm="true" Text="Del" >

 <HeaderStyle Width="35px" />

 </telerik:GridClientDeleteColumn>

 <telerik:GridBoundColumn DataField="id" DataType="System.Int32" HeaderText="id"

 SortExpression="id" UniqueName="id" Visible="False" ForceExtractValue="Always"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="ReportPeriodId" DataType="System.Int32"

 HeaderText="ReportPeriodId" UniqueName="ReportPeriodId" Visible="False"></telerik:GridBoundColumn>

 <telerik:GridTemplateColumn AllowFiltering="False" DataField="CountyName"

 Groupable="False" ShowSortIcon="False" UniqueName="CountyName"><EditItemTemplate><asp:textbox

 ID="CountyNameTextBox" runat="server" ReadOnly="true" Width="150"

 Text='<%#Bind("CountyName")%>'></asp:textbox><asp:RequiredFieldValidator ID="CountyNameValidator" ControlToValidate="CountyNameTextBox" runat="server"

 ErrorMessage=" County is Req."></asp:RequiredFieldValidator>

 </EditItemTemplate>

 <HeaderTemplate>

 <asp:CheckBox ID="CountyCheckBox" runat="server" AutoPostBack="true" CausesValidation="false" onClientClick="window.onbeforeunload=null;savePage=true;"

 EnableViewState="true" oncheckedchanged="CountyCheckBox_CheckedChanged" />

 &#160;County&#160;Name

 </HeaderTemplate>

 </telerik:GridTemplateColumn>

 <telerik:GridTemplateColumn AllowFiltering="False" DataField="StateCode"

 Groupable="False" ShowSortIcon="False" UniqueName="StateCode"><EditItemTemplate><asp:textbox

 ID="StateCodeTextBox" runat="server" ReadOnly="true" Width="25" onChange="this.value=this.value.toUpperCase()"

 Text='<%#Bind("StateCode")%>'></asp:textbox><asp:RegularExpressionValidator ID="StateCodeValidator" ControlToValidate="StateCodeTextBox" ValidationExpression="(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])"

 runat="server" ErrorMessage=" Invalid State Code."></asp:RegularExpressionValidator>

 </EditItemTemplate>

 <HeaderTemplate>

 <asp:CheckBox ID="StateCodeCheckBox" runat="server" AutoPostBack="true" CausesValidation="false" onClientClick="window.onbeforeunload=null;savePage=true;"

 EnableViewState="true" oncheckedchanged="StateCodeCheckBox_CheckedChanged" />

 &#160;State&#160;Code

 </HeaderTemplate>

 </telerik:GridTemplateColumn>

 <telerik:GridTemplateColumn AllowFiltering="False" DataType="System.String"

 DataField="EstimatedP6Population" Groupable="False" ShowSortIcon="False"

 UniqueName="EstimatedP6Population"><EditItemTemplate><asp:textbox

 ID="EstimatedP6PopulationTextBox" runat="server" ReadOnly="true" Width="100"

 Text='<%#Bind("EstimatedP6Population")%>'></asp:textbox><asp:RegularExpressionValidator

 ID="EstimatedP6PopulationValidator" ControlToValidate="EstimatedP6PopulationTextBox" ValidationExpression="\d*" runat="server" ErrorMessage=" Pop. value must be numeric."></asp:RegularExpressionValidator>

 </EditItemTemplate>

 <HeaderTemplate>

 <asp:CheckBox ID="EstimatedP6PopulationCheckBox" runat="server" CausesValidation="false" onClientClick="window.onbeforeunload=null;savePage=true;"

 AutoPostBack="true" EnableViewState="true"

 oncheckedchanged="EstimatedP6PopulationCheckBox_CheckedChanged" />

 &#160;Estimated&#160;P6+&#160;Population

 </HeaderTemplate>

 </telerik:GridTemplateColumn>

 <telerik:GridTemplateColumn AllowFiltering="False" DataType="System.String"

 DataField="InTabSample" Groupable="False" ShowSortIcon="False"

 UniqueName="InTabSample"><EditItemTemplate><asp:textbox

 ID="InTabSampleTextBox" runat="server" Width="100"

 Text='<%#Bind("InTabSample")%>'></asp:textbox><asp:RegularExpressionValidator

 ID="InTabSampleValidator" ControlToValidate="InTabSampleTextBox" ValidationExpression="\d*" runat="server" ErrorMessage=" In-tab value must be numeric."></asp:RegularExpressionValidator>

 </EditItemTemplate>

 <HeaderTemplate>

 In-Tab

 

&nbsp;Sample

 </HeaderTemplate>

 </telerik:GridTemplateColumn>

 </Columns>

 </MasterTableView>

 <clientsettings allowkeyboardnavigation="True">

<Selecting AllowRowSelect="True" />

<clientevents onkeypress="RGCounty_onkeypress"

OnGridCreated="onGridCreated_RGCounty" />

</clientsettings>

 <filtermenu enabletheming="True">

 <collapseanimation duration="200" type="OutQuint" />

 </filtermenu>

 </telerik:RadGrid>

 

 

 

Daniel
Telerik team
 answered on 13 Nov 2008
1 answer
167 views

One of our developers is experiencing a very odd behavior from RadGrid. The grid is returning zeros for "blank" textbox values when using ExtractValuesFromItem to populate a collection. We need it to return something recognizable (either blank or null) Has anyone seen this and figured out a workaround for it?

We are saving the grid's edited items (from a bulk edit grid) by iterating through the EditItems collection with the following code:

 

 

foreach (GridEditableItem editedItem in RGCounty.EditItems)

 

{

 

Hashtable newValues = new Hashtable();

 

 

//The GridTableView will fill the values from all editable columns in the hash

 

 

 

 

RGCounty.Items[editedItem.ItemIndex].OwnerTableView.ExtractValuesFromItem(newValues, editedItem);

 

//string a=RGCounty.Columns[0].ToString();

 

 

 

 

 

string strUpdateCommand = "Update tblCountyData Set ";

 

 

foreach (string strField in newValues.Keys)

 

{

 

if (strField != strIDField)

 

{

strUpdateCommand = strUpdateCommand + strField +

"= '" + newValues[strField] + "', ";

 

}

}

 

 

//Remove last ,

 

 

 

 

strUpdateCommand = strUpdateCommand.Remove(strUpdateCommand.Length - 2);

strUpdateCommand = strUpdateCommand +

" where id=" + newValues[strIDField];
}

And the ASPX looks like this:

 

 

<asp:SqlDataSource ID="SqlCounty" runat="server"

 

 

ConnectionString="<%$ ConnectionStrings:RdiSds %>"

 

 

onselecting="SqlCounty_Selecting"

 

 

DeleteCommand="DELETE FROM tblCountyData WHERE id = @id"

 

 

 

 

SelectCommand="SELECT [id], [ReportPeriodID], [CountyName], [StateCode], CAST([EstimatedP6Population] AS Varchar) AS EstimatedP6Population, CAST([InTabSample] AS Varchar) AS InTabSample FROM [TblCountyData] WHERE ([ReportPeriodId] = @ReportPeriodId) order by IsNull(statecode, 'ZZ'), IsNull(countyname, 'ZZ')"

 

 

ondeleting="SqlCounty_Deleting">

 

 

 

 

<SelectParameters>

 

 

 

 

<asp:Parameter Name="ReportPeriodID" Type="Int32" />

 

 

 

 

</SelectParameters>

 

 

 

 

<DeleteParameters>

 

 

 

 

<asp:Parameter Name="id" Type="Int32"/>

 

 

 

 

</DeleteParameters>

 

 

 

 

</asp:SqlDataSource>

 

 

 

 

<telerik:RadScriptManager ID="CountyRadScriptManager" runat="server" OutputCompression="AutoDetect"></telerik:RadScriptManager>

 

 

 

 

<br />

 

 

 

 

<asp:Label ID="lblError" runat="server" Text="None" Visible="False" ForeColor="#CC3300"></asp:Label>

 

 

 

 

<input id="EstimatedP6PopulationCheckBoxHid" type="hidden" runat="server" enableviewstate="true"/>

 

 

 

 

<telerik:RadGrid ID="RGCounty" runat="server" DataSourceID="SqlCounty"

 

 

GridLines="None" Skin="Office2007" AllowMultiRowEdit="True"

 

 

AutoGenerateColumns="False" BorderStyle="None" onprerender="RGCounty_PreRender"

 

 

ondatabound="RGCounty_DataBound" onitemdatabound="RGCounty_ItemDataBound" CellSpacing="0" CellPadding="0"

 

 

ondeletecommand="RGCounty_DeleteCommand"><MasterTableView Name="t1" DataKeyNames="id" DataSourceID="SqlCounty" ShowFooter="true">

 

 

 

 

<rowindicatorcolumn>

 

 

 

 

<HeaderStyle Width="20px" />

 

 

 

 

</rowindicatorcolumn>

 

 

 

 

<expandcollapsecolumn>

 

 

 

 

<HeaderStyle Width="20px" />

 

 

 

 

</expandcollapsecolumn>

 

 

 

 

<Columns>

 

 

 

 

<telerik:GridClientDeleteColumn ButtonType="PushButton"

 

 

ConfirmText="Are you sure you want to delete the selected row?"

 

 

HeaderStyle-Width="35px" ShowInEditForm="true" Text="Del" >

 

 

 

 

<HeaderStyle Width="35px" />

 

 

 

 

</telerik:GridClientDeleteColumn>

 

 

 

 

<telerik:GridBoundColumn DataField="id" DataType="System.Int32" HeaderText="id"

 

 

SortExpression="id" UniqueName="id" Visible="False" ForceExtractValue="Always"></telerik:GridBoundColumn>

 

 

 

 

<telerik:GridBoundColumn DataField="ReportPeriodId" DataType="System.Int32"

 

 

HeaderText="ReportPeriodId" UniqueName="ReportPeriodId" Visible="False"></telerik:GridBoundColumn>

 

 

 

 

<telerik:GridTemplateColumn AllowFiltering="False" DataField="CountyName"

 

 

Groupable="False" ShowSortIcon="False" UniqueName="CountyName"><EditItemTemplate><asp:textbox

 

 

ID="CountyNameTextBox" runat="server" ReadOnly="true" Width="150"

 

 

 

 

Text='<%#Bind("CountyName")%>'></asp:textbox><asp:RequiredFieldValidator ID="CountyNameValidator" ControlToValidate="CountyNameTextBox" runat="server"

 

 

 

 

ErrorMessage=" County is Req."></asp:RequiredFieldValidator>

 

 

 

 

</EditItemTemplate>

 

 

 

 

<HeaderTemplate>

 

 

 

 

<asp:CheckBox ID="CountyCheckBox" runat="server" AutoPostBack="true" CausesValidation="false" onClientClick="window.onbeforeunload=null;savePage=true;"

 

 

 

 

EnableViewState="true" oncheckedchanged="CountyCheckBox_CheckedChanged" />

 

 

 

 

&#160;County&#160;Name

 

 

</HeaderTemplate>

 

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

<telerik:GridTemplateColumn AllowFiltering="False" DataField="StateCode"

 

 

Groupable="False" ShowSortIcon="False" UniqueName="StateCode"><EditItemTemplate><asp:textbox

 

 

ID="StateCodeTextBox" runat="server" ReadOnly="true" Width="25" onChange="this.value=this.value.toUpperCase()"

 

 

 

 

Text='<%#Bind("StateCode")%>'></asp:textbox><asp:RegularExpressionValidator ID="StateCodeValidator" ControlToValidate="StateCodeTextBox" ValidationExpression="(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])"

 

 

runat="server" ErrorMessage=" Invalid State Code."></asp:RegularExpressionValidator>

 

 

 

 

</EditItemTemplate>

 

 

 

 

<HeaderTemplate>

 

 

 

 

<asp:CheckBox ID="StateCodeCheckBox" runat="server" AutoPostBack="true" CausesValidation="false" onClientClick="window.onbeforeunload=null;savePage=true;"

 

 

 

 

EnableViewState="true" oncheckedchanged="StateCodeCheckBox_CheckedChanged" />

 

 

 

 

&#160;State&#160;Code

 

 

</HeaderTemplate>

 

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

<telerik:GridTemplateColumn AllowFiltering="False" DataType="System.String"

 

 

 

 

DataField="EstimatedP6Population" Groupable="False" ShowSortIcon="False"

 

 

UniqueName="EstimatedP6Population"><EditItemTemplate><asp:textbox

 

 

ID="EstimatedP6PopulationTextBox" runat="server" ReadOnly="true" Width="100"

 

 

 

 

Text='<%#Bind("EstimatedP6Population")%>'></asp:textbox><asp:RegularExpressionValidator

 

 

 

 

ID="EstimatedP6PopulationValidator" ControlToValidate="EstimatedP6PopulationTextBox" ValidationExpression="\d*" runat="server" ErrorMessage=" Pop. value must be numeric."></asp:RegularExpressionValidator>

 

 

 

 

</EditItemTemplate>

 

 

 

 

<HeaderTemplate>

 

 

 

 

<asp:CheckBox ID="EstimatedP6PopulationCheckBox" runat="server" CausesValidation="false" onClientClick="window.onbeforeunload=null;savePage=true;"

 

 

 

 

AutoPostBack="true" EnableViewState="true"

 

 

oncheckedchanged="EstimatedP6PopulationCheckBox_CheckedChanged" />

 

 

 

 

&#160;Estimated&#160;P6+&#160;Population

 

 

</HeaderTemplate>

 

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

<telerik:GridTemplateColumn AllowFiltering="False" DataType="System.String"

 

 

DataField="InTabSample" Groupable="False" ShowSortIcon="False"

 

 

UniqueName="InTabSample"><EditItemTemplate><asp:textbox

 

 

ID="InTabSampleTextBox" runat="server" Width="100"

 

 

Text='<%#Bind("InTabSample")%>'></asp:textbox><asp:RegularExpressionValidator

 

 

 

 

ID="InTabSampleValidator" ControlToValidate="InTabSampleTextBox" ValidationExpression="\d*" runat="server" ErrorMessage=" In-tab value must be numeric."></asp:RegularExpressionValidator>

 

 

 

 

</EditItemTemplate>

 

 

 

 

<HeaderTemplate>

 

 

 

In-Tab

&nbsp;Sample

 

 

</HeaderTemplate>

 

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

</Columns>

 

 

 

 

</MasterTableView>

 

 

 

 

<clientsettings allowkeyboardnavigation="True">

 

 

 

 

<Selecting AllowRowSelect="True" />

 

 

 

 

<clientevents onkeypress="RGCounty_onkeypress"

 

 

OnGridCreated="onGridCreated_RGCounty" />

 

 

 

 

</clientsettings>

 

 

 

 

<filtermenu enabletheming="True">

 

 

 

 

<collapseanimation duration="200" type="OutQuint" />

 

 

 

 

</filtermenu>

 

 

 

 

</telerik:RadGrid>

 

Daniel
Telerik team
 answered on 13 Nov 2008
1 answer
843 views
Im trying to set a RadNumericTextbox to the value of 0 which is coming from the database. I keep getting the following error though when the value is trying to bind to the Rad control.

'Specified cast is not valid.'

The data type is an Integer which is set using the code below. If i change the value of Floors to be double this works fine for some reason?! Surely these controls can use integer data types?

Private _Floors As Integer 
    Public Property Floors() As Integer 
        Get 
            Return _Floors 
        End Get 
        Set(ByVal value As Integer) 
            _Floors = value 
        End Set 
    End Property 

Here is my code for the RadNumericTextbox

<telerik:RadNumericTextBox  
       Skin=""  
       Type="Number"  
       ID="Floors"  
       Value='<%# Bind("Floors") %>' 
       runat="server" /> 


Look forward to hearing your solutions.

Thanks in advance.
David
Missing User
 answered on 13 Nov 2008
1 answer
171 views

Hi Friends,

I am using Telerik Rad Tree View(v2.0.50727) and I have following handler associated with the 
OnNodeDrop  event of the Tree view Control.

protected void rTreeView_NodeDrop(object o, RadTreeNodeEventArgs e)

{
}

Moreover I am calling a JavaScript handler(function) on the Client Side event
BeforeClientDrop, which returns true at the end.
When I drag any node and drop onto some other node, the client side event is getting executed but the Server Side handler is not executed at all.

Please let me know the reason behind not executing the Server Side event OnNodeDrop. 

 

Thanks in advance.

 

-

Mehul

 

Atanas Korchev
Telerik team
 answered on 13 Nov 2008
1 answer
203 views
I have an application.....My structure is in this format...

Master Page --------------- Content Page --------------------UserControl ----------------RadWindow

Master Pages  ........I have AjaxManager on MasterPage

Content Pages ....... I have ProxyAjaxManager on this page

UserControl ............ I have A RadGrid place on this UserControl and few Button ...Each Button opens a RadWIndow

RadWindow .............. When I hit button on these Radwindow I just want update RadGrid

Right Now I have implemented in a such a way that it refresh whole page...I do it my javascript...form.Control[0].submit()..If that matter..

Please help me ..

Thanks,
DIP

 
Georgi Tunev
Telerik team
 answered on 13 Nov 2008
4 answers
97 views
I upgraded a site of mine to the latest, Q3.  I just noticed now that the rotator buttonsover type isn't behaving like it use to.  Prior to the upgrade I would hover over the buttons and scroll through the entire list of images.  When it got to the end, it would repeat through starting with the first.  After the ugprade, it scrolls through 3 and then stops completely. 

I did some research and found a "WrapFrames" property, which sounds like what I want.  I set it to "true" and it didn't fix the problem.  Keep in mind I didn't have this property in the last version (not sure if it exisited).

I looked at the online demo and it seems to be doing the same.

http://demos.telerik.com/aspnet/prometheus/Rotator/Examples/Default/DefaultCS.aspx

Select buttonsover and wrap frames.  You'll notice (FireFox 3 here) that it scrolls a few and then stops.



Georgi Tunev
Telerik team
 answered on 13 Nov 2008
5 answers
209 views
Hi, I have been searching some information about how to use an ajax Loading panel with Radwindows, but I haven't had good luck, anyone can give me some link o article? Thanks
Georgi Tunev
Telerik team
 answered on 13 Nov 2008
5 answers
273 views
Hello!

Is this possible to change tab using client-side javascript when TabStrip is "ajaxified" and connected to MultiPage which renders only selected page?

I need something like this:

<span onclick="changeTab("secondtabID")">Change to second tab</span> 

this will be placed somethere outside Multipage.

Thanks in advance
Paul
Telerik team
 answered on 13 Nov 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?