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

I have a database with a company and a persons table. The person table has an FK to the CompanyID in the company table.
A person can be connected to a company (or not)
In my company grid, I have a separate grid (not a detailsgrid!) in a nested template
On expand, the template is shown and the connected persons grid is shown

For the persons grid on the nested template I have an ordinary RADGrid and I have a delete column and i replaced the text with an image. But for the delete function actualy I need to have two types of delete

option 1 deletes the complete person in the person table (normal delete function in the grid)
option 2 clears only the FK to the company and makes it a stand alone person, not connected to a company

I was considering a second delete column with a imagebutton which click event I can catch directly in VB code behind but I don't know how to.

Anyone an idea how to approach this?

Rick Rehorst
Top achievements
Rank 1
 answered on 17 Nov 2009
1 answer
155 views
*** EDIT ***
I realized that you need to use the

DataValueField

In order to populate that value correctly not the

DataKeyField


I would like to transfer both the ListItem Value and Text between 2 list boxes.

Is this possible using the standard RadListBox control?

The Value would contain a record id and the text...well some text...

Thanks
Peter
Shinu
Top achievements
Rank 2
 answered on 17 Nov 2009
3 answers
176 views
I'm trying to load a chart on a virutal path using the new routing function in .NET 3.5 SP1.  I keep getting the Error loading RadChart image error.  It works fine when I put the chart on a page that isent virtual.  I think with the virtual path the link to the image is getting lost somewhere.  When I right click the red X and look at the path its telling me its looking for the ChartImage.axd inside of my virtual path.  How can I fix this?
Vladimir Milev
Telerik team
 answered on 17 Nov 2009
1 answer
133 views
Hi,

I had a javascript prompt box which is being displayed upon some business validations and when the user clicks ok, I was trying to fire click event of a button to perform insert operation but I am unable to find the ID of the button, I am registering the javascript in code behind using scriptmanager.registerstartupscript, my web page has a master page, radgrid, update panel, radloadingpanel.
below is the code where i am trying to pull the ID of the button.
Dim js As String  
        js = _ 
                       "       var promptpromptComments=prompt(Validation failed, still want to proceed','Comments...');" & _  
                       "       if(promptComments!=null && promptComments!='')" & _  
                       "       {" & _  
                       "        document.getElementById('<% InsertRecord.ClientID %>').click;"  & _  
                       "        document.getElementById('InsertCmtsHdnFld').value=promptComments;" & _  
                       "       } " & _  
                       "       else" & _  
                       "       {" & _  
                       "       alert('insert has been terminated');" & _  
                       "       }"  
 
        ScriptManager.RegisterStartupScript(Me, GetType(Page), "PromptScript", js, True) 
Also I am unable to find the hidden field id as well

I am doing this so as to perform an insert operation based on the response from user. Hence trying to fire a click event and perform insert operation in it.

I am registering the javascript in insert command event. I must be missing something eay here but unable to find it, Anyhelp would be greatly appreciated.

Shinu
Top achievements
Rank 2
 answered on 17 Nov 2009
2 answers
77 views
I need to find the update event for other recreate user control(on click of OK button) similar to update user control(as on click of UPDATE button) in the grid from the code behind. Concerned image file illustrating this has been attached with this post.

 if (e.CommandName == RadGrid.UpdateCommandName)
            {
                UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
                RadTextBox txtOrderValue = userControl.FindControl("txtOrderValue") as RadTextBox;


These user controls are loading in grid as the user hits concerned image buttons in the grid.



Thanks,
Awadh
Awadh .
Top achievements
Rank 1
 answered on 17 Nov 2009
0 answers
161 views
hi

I know this is not a proper place to post my thread.Am sorry.

I have this code and i am not to get the retun value from the proc. I did a breakpoint on the function and the invoice variable is empty.

What is worng with this code? Thanks

ALTER PROCEDURE [dbo].[spGetName]
@prodID as nvarchar(50)
AS
BEGIN
Declare @invoiceID as Nvarchar(50)
Set @invoiceID = Replace(replace(Replace(replace(CONVERT(Nvarchar(50),Getdate(),120),'-',''),' ' ,''),':',''),'.','')
Insert into dbo.Invoice(invoiceID,ProdID) values(@invoiceID,@prodID)
Return @invoiceID
END



 Shared Function Invoice(ByVal prodID As String) As String
        Dim Invoice As String
        Using sqlcmd As New SqlCommand("spGetName", getConn)
            sqlcmd.CommandType = Data.CommandType.StoredProcedure
            sqlcmd.Parameters.Add(New SqlParameter("@prodID", SqlDbType.NVarChar, 50)).Value = prodID 
            Invoice = sqlcmd.Parameters.Add(New SqlParameter("@Return_Value", SqlDbType.NVarChar, 50)).Direction = ParameterDirection.ReturnValue
     sqlcmd.ExecuteNonQuery()       
 End Using
        getConn.Close()
        Return Invoice
    End Function

 

L
Top achievements
Rank 1
 asked on 17 Nov 2009
4 answers
136 views
hi

I am able to insert, but when try to update, it doesn't give an error and it didn;t get updated. here is my code

       <telerik:RadScheduler ID="RadScheduler1" runat="server"
                    DataEndField="Appt_EDateTime" DataKeyField="Appt_ID"
                    DataSourceID="sdsAppointment" DataStartField="Appt_SDateTime" 
                    DayStartTime="09:00:00" DayEndTime="22:00:00"
                    DataSubjectField="Appt_Remark" RowHeight="35px" 
                    HoursPanelTimeFormat="hh:mm" Skin="Outlook" TimeLabelRowSpan="1"
                    EnableCustomAttributeEditing="True" CustomAttributeNames="Cust_Name,Appt_Remark,Room_No"
                    ValidationGroup="RadScheduler1" NumberOfHoveredRows="1"
                    TimelineView-UserSelectable="False" MonthView-UserSelectable="False"
                    SelectedView="WeekView" ShowAllDayRow="False" Width="99.9%"  MinimumInlineFormHeight="200"
                    style="top: 0px; left: 0px; height: 622px"
                    StartEditingInAdvancedForm="False">                    
                    <AppointmentTemplate>               
                    <%#Eval("Cust_Name")%>
                    <br />
                    Room:<%#Eval("Room_No")%>
                    <br />
                    <%#Eval("Appt_Remark")%>
            </AppointmentTemplate>

<InlineInsertTemplate>
                Cust Name:<br />
            <asp:TextBox runat="server" ID="Cust_NameTextBox" Text='<%# Bind("Cust_Name") %>' Width="200px"  BorderColor="DarkGray" BorderWidth="1px"  BorderStyle="Solid"></asp:TextBox>&nbsp;
               &nbsp;<br />
                    Room:&nbsp;<telerik:RadComboBox ID="drpRoomSelect" selectedValue='<%# Bind("Room_No") %>' DataSourceID="sdsRoomSelect" DataValueField="Room_No"  DataTextField="Room_No"  runat="server">
                    </telerik:RadComboBox>
                   &nbsp;<br />Remark:&nbsp;<asp:TextBox runat="server" ID="Appt_RemarkTextBox" Text='<%# Bind("Appt_Remark") %>' TextMode="MultiLine" Height="100px" Width="200px"  BorderColor="DarkGray" BorderWidth="1px"  BorderStyle="Solid"></asp:TextBox>

                 <asp:LinkButton runat="server" ID="InsertLinkButton" CommandName="Insert" Text="Insert"></asp:LinkButton>&nbsp;
                 <asp:LinkButton runat="server" ID="CancelLinkButton" CommandName="Cancel" Text="Cancel"></asp:LinkButton>
            </InlineInsertTemplate>
           
            <InlineEditTemplate>
                  &nbsp;Cust Name:&nbsp;
            &nbsp;<asp:TextBox runat="server" ID="Cust_NameTextBox" Text='<%# Bind("Cust_Name") %>' BorderColor="DarkGray" BorderWidth="1px"  Width="200px" BorderStyle="Solid"></asp:TextBox>&nbsp;
                &nbsp;<br />
                    Room:&nbsp;<telerik:RadComboBox ID="drpRoomSelect" selectedValue='<%# Bind("Room_No") %>' DataSourceID="sdsRoomSelect" DataValueField="Room_No"  DataTextField="Room_No"  runat="server">
                    </telerik:RadComboBox>
                    &nbsp;<br />Remark:&nbsp;<asp:TextBox runat="server" ID="Appt_RemarkTextBox" Text='<%# Bind("Appt_Remark") %>' TextMode="MultiLine" BorderColor="DarkGray" BorderWidth="1px"  BorderStyle="Solid" Height="100px" Width="200px"></asp:TextBox>
                   
                 <asp:LinkButton runat="server" ID="UpdateLinkButton" CommandName="Update" Text="Update"></asp:LinkButton>&nbsp;
                 <asp:LinkButton runat="server" ID="CancelLinkButton" CommandName="Cancel" Text="Cancel"></asp:LinkButton>
            </InlineEditTemplate>




<asp:SqlDataSource ID="sdsAppointment" runat="server"
                    ConnectionString="<%$ ConnectionStrings:MConnectionString %>"
                    DeleteCommand="spAppointment_Delete" DeleteCommandType="StoredProcedure"
                    InsertCommand="spAppointment_Insert" InsertCommandType="StoredProcedure"
                    SelectCommand="spAppointment_Select" SelectCommandType="StoredProcedure"
                    UpdateCommand="spAppointment_Update" UpdateCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:CookieParameter CookieName="branchid" Name="Branch_ID" Type="Int32" />
                    </SelectParameters>
                    <DeleteParameters>
                        <asp:Parameter Name="Appt_ID" Type="Int32" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="Appt_ID" Type="Int32" />
                        <asp:Parameter Name="Appt_SDateTime" Type="DateTime" />
                        <asp:Parameter Name="Appt_EDateTime" Type="DateTime" />
                        <asp:Parameter Name="Appt_Remark" Type="String" />
                        <asp:Parameter Name="Cust_Name" Type="String" />
                        <asp:CookieParameter Name="Branch_ID" CookieName="branchid" Type="Int16" />
                        <asp:Parameter Name="Room_No" Type="String" />
                    </UpdateParameters>
                    <InsertParameters>
                        <asp:Parameter Name="Appt_SDateTime" Type="DateTime"/>
                        <asp:Parameter Name="Appt_EDateTime" Type="DateTime" />
                        <asp:Parameter Name="Appt_Remark" Type="String" />
                        <asp:Parameter Name="Cust_Name" Type="String" />
                        <asp:CookieParameter Name="Branch_ID" CookieName="branchid" Type="Int16" />
                        <asp:Parameter Name="Room_No" Type="String" />
                    </InsertParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="sdsRoomSelect" runat="server"
                    ConnectionString="<%$ ConnectionStrings:MConnectionString %>"
                    SelectCommand="spAppointment_RoomSelect" SelectCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:CookieParameter CookieName="branchid" Name="Branch_ID" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>

ALTER proc [dbo].[spAppointment_Update]
@Appt_ID as int,
@Appt_SDateTime datetime = null,
@Appt_EDateTime datetime = null,
@Appt_Remark as nvarchar(1000),
@Cust_Name as Nvarchar(100),
@Branch_ID as int,
@Room_No as Nvarchar(50)
as
UPDATE [dbo].[Appointment]
   SET [Appt_SDateTime] = @Appt_SDateTime
      ,[Appt_EDateTime] = @Appt_EDateTime
      ,[Appt_Remark] = @Appt_Remark
      ,[Cust_Name] = @Cust_Name
      ,[Branch_ID] = @Branch_ID
      ,[Room_No] = @Room_No
    WHERE Appt_ID = @Appt_ID

L
Top achievements
Rank 1
 answered on 17 Nov 2009
1 answer
150 views
Hey,

I have a list box and the items are bound at runtime by a datatable. My list box items are check boxes. I want to arrange the items in 3 columns.

Thanks in advance
Schlurk
Top achievements
Rank 2
 answered on 16 Nov 2009
3 answers
141 views
Hi,
           I am trying to open a rad window from a rad grid to show some details. Now i see some record and close and open another record to see details it takes while to refresh and show the latest details. The issus is that when the window opens it still has ols details and after a while it reloads to show new details . Is it possible foe the rad window to show latest details whenever it opens up and not refresh after it opens up . Please let me know your feedback.


Regards,
Ajit
ajit
Top achievements
Rank 1
 answered on 16 Nov 2009
2 answers
111 views
I have a GridBoundColumn that is a DateTime type. What is the best way to change the date incase there is no value for it? If a value is not set it is either null or is automatically set to the minimum date value in .net

Thank you,
Daniel
Daniel
Top achievements
Rank 1
 answered on 16 Nov 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?