Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
82 views
Hi,

   I Need Validation controls at TemplateForm of Grid using Custom Validators. How get the controls by javasript function?

<EditFormSettings ColumnNumber="2" CaptionDataField="CodigoProduto"  CaptionFormatString="Edit properties of Product {0}">                                                 
                                                <FormTemplate> 
                                                    <table style="width:100%;">  
                                                        <tr> 
                                                            <td><asp:Label ID="lblProduto" runat="server" Text="Código do produto:" CssClass="cad-lbl" /></td>  
                                                            <td colspan="5">  
                                                                <asp:TextBox ID="txtProdutoCodigo" runat="server" ReadOnly="true"></asp:TextBox> 
                                                                <asp:HiddenField ID="hdfProdutoCodigo" runat="server"   
                                                                    onvaluechanged="hdfProdutoCodigo_ValueChanged" /> 
                                                                  
                                                                <button onclick="openWin(); return false;" class="btn">  
                                                                    Buscar</button>   
                                                            </td>                                                              
                                                        </tr> 
                                                        <tr> 
                                                            <td> 
                                                                <asp:Label ID="lblQuantidade" runat="server" Text="Quantidade (m):" CssClass="cad-lbl"/>  
                                                                <asp:RequiredFieldValidator ID="rfvQuantidade" ValidationGroup="Produto" runat="server" 
                                                                    ControlToValidate="ntxtQuantidade" ErrorMessage="O campo Quantidade é obrigatório." 
                                                                    Text="*"></asp:RequiredFieldValidator> 
                                                            </td> 
                                                            <td> 
                                                                <vm2:NumericTextBox ID="ntxtQuantidade" runat="server" MinValue="0" onblur="onblurQuantidade()"  CssClass="cad-txt" EnableEmbeddedSkins="false" Skin=""/>                                      
                                                            </td> 
                                                            <td> 
                                                                <asp:Label ID="lblLances" runat="server" Text="Lances:" CssClass="cad-lbl"></asp:Label> 
                                                                <asp:RequiredFieldValidator ID="rfvLances" ValidationGroup="Produto" runat="server" 
                                                                    ControlToValidate="ntxtLances" ErrorMessage="O campo Lances é obrigatório." Text="*"></asp:RequiredFieldValidator> 
                                                            </td> 
                                                            <td> 
                                                                <vm2:NumericTextBox ID="ntxtLances" NumberFormat-DecimalDigits="0" onblur="onblurLance()" 
                                                                    runat="server" MinValue="0"  CssClass="cad-txt" EnableEmbeddedSkins="false" Skin=""/>  
                                                            </td> 
                                                            <td> 
                                                                <asp:Label ID="lblMetragem" runat="server" Text="Metragem:" CssClass="cad-lbl"></asp:Label> 
                                                            </td> 
                                                            <td> 
                                                                <asp:TextBox ID="txtMetragem" runat="server" ReadOnly="true" CssClass="cad-txt"></asp:TextBox> 
                                                                <asp:HiddenField ID="hdfMetragem" runat="server" /> 
                                                            </td> 
                                                        </tr> 
                                                        <tr> 
                                                            <td> 
                                                                <asp:Label ID="lblPrecoAplicado" runat="server" Text="Preço Aplicado:" CssClass="cad-lbl"></asp:Label> 
                                                            </td> 
                                                            <td> 
                                                                <asp:TextBox ID="txtPrecoAplicado" runat="server" ReadOnly="true" CssClass="cad-txt"></asp:TextBox> 
                                                                <asp:HiddenField ID="hdfPrecoAplicado" runat="server" /> 
                                                            </td> 
                                                            <td> 
                                                                <asp:Label ID="lblAcondicionamento" runat="server" Text="Acondicionamento:" CssClass="cad-lbl"></asp:Label> 
                                                                <asp:CompareValidator ID="cpvAcondicionamento" runat="server" ValueToCompare="-- Selecione --" 
                                                                ValidationGroup="Produto" ControlToValidate="ddlAcondicionamento" Operator="NotEqual" 
                                                                ErrorMessage="O campo Acondicionamento é obrigatório." Text="*"></asp:CompareValidator>                      
                                                            </td> 
                                                            <td> 
                                                                <vm2:Combobox ID="ddlAcondicionamento" runat="server" Skin="Office2007" CssClass="cad-ddl" 
                                                                    ZIndex="9000" OnItemDataBound="ddlAcondicionamento_ItemDataBound">  
                                                                </vm2:Combobox> 
                                                            </td> 
                                                            <td colspan="2">  
                                                                <asp:Button ID="btnAdicionarProduto" runat="server" Text="Adicionar" ValidationGroup="Produto" 
                                                                    OnClick="btnAdicionarProduto_Click" CssClass="btn" /> 
                                                            </td>                                                              
                                                        </tr>                                                          
                                                    </table> 
                                                </FormTemplate> 
                                            </EditFormSettings> 
Princy
Top achievements
Rank 2
 answered on 31 Aug 2009
1 answer
92 views
Hello I am kind of new with the Date picker. I need to have a calendar that selects a week and display that work week, that can only start on Monday, so the user can only click monday dates only, and then i want to take the values and display them in a text box. I've looked around the site and was not able to find anything.
Princy
Top achievements
Rank 2
 answered on 31 Aug 2009
2 answers
132 views
I have a project need dynamic create multiple grids based on a value in collection object. I need use Grid_NeedDataSource to bind grid. In Grid_NeedDataSource event I call a method BindGrid(). In OnInit event I have following code:

protected override void OnInit(EventArgs e)
{
Collection categories = GetCategories();
foreach (String category in categories)
{
  DefindGridStructure(category);
}
}

The method DefindGridStructure(category) will create a datagrid based on category value. 

void rgGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        BindGrid(CategoryKey);
    }

My question is how can I get Category value in rgGrid_NeedDataSource event. I can't use viewstate value since it will be always the last value of the collection. 
Veli
Telerik team
 answered on 31 Aug 2009
1 answer
144 views
Hello,

i got a problem and it's importent so find a comfortable and quick solution. i hope to get help.

i got a radgrid and a htmltable on a page. the htmltable got a basic style.. so it doesnt look very well and i want to skin the htmltable like the skin i used for my radgrid.

so is there any possibility to skin a htmltable with telerik skin?


Many Tanks

Chris
Shinu
Top achievements
Rank 2
 answered on 31 Aug 2009
1 answer
341 views
hi all.
my problem is about the grid client event, i have a RadGrid, RadAjaxManager in this manager , i chose radgrid and i want to update the text box.
when i wrote a javascript for client event OnRowDoubleClick in pages aspx. i wrote a function
             function RowDblClick(sender,args){....}      
and i double click on Row , it's happened
    But when i wrote it in code behind (because i want to take a data in my database to update the testbox) i have the problem.if i don't have 2 parameters sender and args i sure the event  onrowdlouble click would not happen and i don't know how to chose the type for sender and args. could you give me a right function with right parameter to make the row double click on grid happen in code behind please.
thank you for listening.

Shinu
Top achievements
Rank 2
 answered on 31 Aug 2009
1 answer
100 views
Hi experts

I seem to have a probem with Firefox 3; it wants to add a vertical scrollbar even though
the content is well within the fixed window size. It also does the same thing
if autoresize is true.  (  but IE is OK in both cases ).

How can I get rid of this? eg with CSS or a code behind fix.

I assume this is a Firefox 'feature'.

Thanks

Clive

P.S using Q2 2009, IIS7 asp.net 3.5
Georgi Tunev
Telerik team
 answered on 31 Aug 2009
1 answer
88 views
Hi,

I have a asp.net application in which im using RAD alert windows.
When the RAD alert window opens it grays out the screen behind (modal)
While it grays the screen behind, the dropdowns on the screen become invisible.
Rest all controls are working fine.

How to keep the dropdown visible even if he screen is grayed on display of RAD alert windows?

Thanks and Regards,
Indira
Georgi Tunev
Telerik team
 answered on 31 Aug 2009
2 answers
139 views

I am getting an Ajax error when I use the following code when I add an appoint. the error is as follows:
-----------------------------------------------------------------------------------------------
Sys.Webforms.pagerequestmanagerServerErrorException:Item has already been added. Key in dictionary:;'ID' key being added: 'ID'.
--------------------------------------------------------------------------------------------------
I am getting similar errors when I delete or update. There is no codebehind code, I am just uing SQLDatasource. I checked that the Appointments table has ID field which is an identity field.
Please let me know.
----------------------------------------------------Code----------------------------------------------------------

<
asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:RadSchedulerConnectionString %>"

SelectCommand="SELECT * FROM [Appointments]" ProviderName="System.Data.SqlClient"

InsertCommand ="INSERT INTO [Appointments] ([Subject], [Start], [End], [RoomID], [UserID], [RecurrenceRule], [RecurrenceParentID]) VALUES (@Subject, @Start, @End , @RoomID, @UserID, @RecurrenceRule, @RecurrenceParentID)"

UpdateCommand="UPDATE [Appointments] SET [Subject] = @Subject, [Start] = @Start, [End] = @End, [RoomID] = @RoomID, [UserID] = @UserID, [RecurrenceRule] = @RecurrenceRule, [RecurrenceParentID] = @RecurrenceParentID WHERE (ID = @ID)"

DeleteCommand="DELETE FROM [Appointments] WHERE [ID] = @ID"

>

<DeleteParameters>

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

</DeleteParameters>

<UpdateParameters>

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

<asp:Parameter Name="Subject" Type="String" />

<asp:Parameter Name="Start" Type="DateTime" />

<asp:Parameter Name="End" Type="DateTime" />

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

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

<asp:Parameter Name="RecurrenceRule" Type="String" />

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

</UpdateParameters>

<InsertParameters>

<asp:Parameter Name="Subject" Type="String" />

<asp:Parameter Name="Start" Type="DateTime" />

<asp:Parameter Name="End" Type="DateTime" />

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

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

<asp:Parameter Name="RecurrenceRule" Type="String" />

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

</InsertParameters>

</asp:SqlDataSource>

Jason
Top achievements
Rank 2
 answered on 31 Aug 2009
2 answers
166 views
I am getting this error when I am trying to update, delete, or insert an item in scheduler:

Sys.WebForms.PageRequestManagerServerErrorException: Item has already been added. Key in dictionary: 'ScheduleID' Key being added: 'ScheduleID'

I am using an access data base and nothing in the code behind file.

Here is the aspx code I am using:

<

telerik:RadScheduler ID="RadScheduler1" runat="server" DataEndField="End"

DataKeyField="ScheduleID" DataRecurrenceField="ScheduleID"

DataRecurrenceParentKeyField="ScheduleID" DataSourceID="AccessDataSource1"

DataStartField="Start" DataSubjectField="Subject">

</telerik:RadScheduler>

<asp:AccessDataSource ID="AccessDataSource1" runat="server"

DataFile="~/Database/AmbLL.mdb"

DeleteCommand="DELETE FROM [Schedule] WHERE [ScheduleID] = ?"

InsertCommand="INSERT INTO [Schedule] ([ScheduleID], [Subject], [Start], [End]) VALUES (?, ?, ?, ?)"

SelectCommand="SELECT * FROM [Schedule]"

UpdateCommand="UPDATE [Schedule] SET [Subject] = ?, [Start] = ?, [End] = ? WHERE [ScheduleID] = ?">

<DeleteParameters>

<asp:Parameter Name="ScheduleID" Type="String" />

</DeleteParameters>

<UpdateParameters>

<asp:Parameter Name="Subject" Type="String" />

<asp:Parameter Name="Start" Type="DateTime" />

<asp:Parameter Name="End" Type="DateTime" />

<asp:Parameter Name="ScheduleID" Type="String" />

</UpdateParameters>

<InsertParameters>

<asp:Parameter Name="ScheduleID" Type="String" />

<asp:Parameter Name="Subject" Type="String" />

<asp:Parameter Name="Start" Type="DateTime" />

<asp:Parameter Name="End" Type="DateTime" />

</InsertParameters>

</asp:AccessDataSource>

Any suggestions?

Jason
Top achievements
Rank 2
 answered on 31 Aug 2009
3 answers
140 views
Hello,
I am trying to use radGrid inside a SharePoint web part to bind to a list.
I am using SPDataSource to connect to the list, and I set the grid's DataSourceID.
Everything works fine but for tow extra columns that are being added to the grid by themselves.
The columns are "UseInternalName" and "IncludeHidden" which are 2 public properties of the SPDataSource control, but have nothing to do with the list.
Needless to say I am explicitly setting AutoGenerateCullomns to False, and I manually add my columns.
What's more interesting, is that if I bind to ASP's GridView using the exact same syntax, I got expected behavior, without the 2 extra columns.

Any suggestions?

Thanks,
Elad.
Mario
Top achievements
Rank 1
 answered on 30 Aug 2009
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?