Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
125 views
How do I get the Primary Key of the row in which a radio button is selected. I have tried:

   Protected Sub rbt_VehicleImage_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
    
        Dim item As GridDataItem = DirectCast(TryCast(sender, RadioButton).NamingContainer, GridDataItem)
        Dim rdBtn As RadioButton = TryCast(sender, RadioButton)   
  
        If rdBtn.Checked = True Then
  
            Dim sql As String
            Dim strConnString As [String] = System.Configuration.ConfigurationManager.ConnectionStrings("CF_SQL_Connection").ConnectionString()
            sql = "UPDATE CF_Images SET DefaultImage = @Value WHERE IDVehicles = 175"
            Dim connection As New SqlConnection(strConnString)
            Dim command As New SqlCommand(sql, connection)
  
            command.Parameters.Add("@Value", SqlDbType.Int).Value = "0"
            command.Connection.Open()
            command.ExecuteNonQuery()
            command.Connection.Close()
  
            Dim sql1 As String
            Dim strConnString1 As [String] = System.Configuration.ConfigurationManager.ConnectionStrings("CF_SQL_Connection").ConnectionString()
            sql1 = "UPDATE CF_Images SET DefaultImage = @Value WHERE IDVehicles = 175 AND IDImages = @IDImages"
            Dim connection1 As New SqlConnection(strConnString1)
            Dim command1 As New SqlCommand(sql1, connection1)
  
            command1.Parameters.Add("@Value", SqlDbType.Int).Value = "1"
            command1.Parameters.Add("@IDImages", SqlDbType.Int).Value = 333
            command1.Connection.Open()
            command1.ExecuteNonQuery()
            command1.Connection.Close()

            Dim ID As GridBoundColumn = DirectCast(rg_VehicleImages.MasterTableView.GetColumn("IDImages"), GridBoundColumn)
            Dim ID2 As String = Convert.ToString(ID)
            Label1.Text = ID2
  
        Else
  
        End If
  
    End Sub
End Class

However the IDImages value is empty.

ANy help appreciated.
Maria Ilieva
Telerik team
 answered on 27 Oct 2010
3 answers
134 views
Hi, I have a date field, timepicker field.
When i open the timepicker popup, it hides the popup if i click anywhere else than the calendar Icon of the date field (both popups are shown, they overlap because of the space constraint).

Any help on how to hide the timepicker popup, on click of the calendar icon

regards,
Naresh
Dimo
Telerik team
 answered on 27 Oct 2010
3 answers
104 views
i want to increase height and width of editor using javascript.
i tried it using 
var RadEditor2_contentIframe = getObject("RadEditor2_contentIframe")
and then increasing height of RadEditor2_contentIframe using javascript.
it is working fine for me in all the browsers. but when i m switching between the modes like design, code and preview my window size shrinks in IE n chrome.
i tried var RadEditor2_contentArea = $find(radEditorClientId).get_contentArea(), but still result is same.

thanks
    
Rumen
Telerik team
 answered on 27 Oct 2010
2 answers
210 views
Hi All,

I (may) have a problem with an application containing a radgrid.
Because I do not know the number of columns at designtime, I declared the radgrid in the aspx file without columns, and build the grid structure in the code behind (In the NeedDataSource() event after data is fetched from the database).

In order to create 3 footerrows, my plan was to create a footertemplate, but I have read that this must be done in the page_init event.
During page_init however, I do not know the number of columns to create .... so I was stuck here.

I may have found a solution that works (Inspired from another thread about 2 HeaderRows).
During Grid.PreRender i add additional footerrows. It seems to work ok, but I am not sure if this is reliable.

Any comments ?

Thanks.
 
Here is the code:
 
Protected Sub Grid_TimeSheet_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Grid_TimeSheet.PreRender
    AddFooterRow(1)
    AddFooterRow(2)
End Sub
 
Protected Sub AddFooterRow(ByVal marker As Integer)
    ' get the current footer
    Dim footer As GridItem() = Grid_TimeSheet.MasterTableView.GetItems(GridItemType.Footer)
    ' get the current TFoot element
    Dim foot As GridTFoot = CType(footer(0).Parent.Controls(0).Parent, GridTFoot)
    Dim LastFooterPos As Integer = 0
 
    For n = 0 To foot.Controls.Count - 1
        If TypeOf (foot.Controls(n)) Is GridFooterItem Then
            LastFooterPos = n
        End If
    Next
    Dim newFooterItem As GridFooterItem = New GridFooterItem(Grid_TimeSheet.MasterTableView, 0, 0)
    PopulateNewFooterItem(newFooterItem, foot.Controls(LastFooterPos), marker)
    foot.Controls.AddAt(LastFooterPos + 1, newFooterItem)
 
End Sub
 
Protected Sub PopulateNewFooterItem(ByVal footer As GridFooterItem, ByVal existingfooter As GridFooterItem, ByVal marker As Integer)
    For Each fc In existingfooter.Cells
        Dim new_fc As TableCell = New TableCell
        new_fc.Text = marker.ToString()
        footer.Cells.Add(new_fc)
    Next
 
End Sub


Jens Olesen
Top achievements
Rank 1
 answered on 27 Oct 2010
3 answers
136 views
We have a telerik popup window with text fieds and Save/Cancel buttons.

We have these issues:

1. If I press enter key it takes back to the parent window
2. If I set default button to panel, either Save or Cancel is working

Ex:

I have telerik popup window with Save set as default button to the panel.

Upon hitting enter key when focus is on Save button the record is saved.

Upon hitting enter key when focus is on Cancel button the popup window is to be closed, but it is saved!

Any workaround please?!

Thank you

Regards
Raj
Georgi Tunev
Telerik team
 answered on 27 Oct 2010
6 answers
96 views
I am using the scheduler a bit differently then how it was originally intended. We are using it to schedule employees for shifts to work. Most employees work the same shift, so instead of manually going through and adding in each employee to a time I created a form that will allow you to select multiple employees, multiple days, and a start and end time. I would like to move this to the AdvancedInsertTemplate instead of through a radwindow. My only issue with doing this is that I see no way of calling the command that shows the AdvancedInsertTemplate . Is there a command I am missing? I have disabled the insert by clicking on a time as this isn't valid for the application I have created.
Peter
Telerik team
 answered on 27 Oct 2010
1 answer
146 views
Hi,
Am Very new to Telerik and ASp.net.
I am facing problems with Custom validators in Telerik panel.
I need to throw an error in the validation summary when the custom validator is fired. The custom validator has  validation method in server side.
The problem is, the custom validator successfully displays errors in validation summary in case of normal page.
But since the text boxes are in telerik panel the custom validator can only dispaly messages inline, where the validator is present(Text attribute of custom validator). The error message attribute of custom validator, which is supposed to show the message in validation summary, does not work.
Pl help, as dispalying the message in validation summary is the requirement.

Note: Required field validator and regular expression validator works fine by displaying messages in validation summary in telerik panels. Also, I have associated the validators with validation groups of validation summary for required field, regular expression and custom validators.
Iana Tsolova
Telerik team
 answered on 27 Oct 2010
2 answers
59 views
pls help...

I have a web page with RadAjaxManager as below

  <telerik:RadAjaxManager ID="radAjaxManager" runat="server"
        EnableViewState="false" EnableAJAX="true" EnableEmbeddedScripts="true"             
        UpdatePanelsRenderMode="Block"  />     

I have user control in this page which needs another RadAjaxManager for which i use RadAjaxManagerProxy as below

  <telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadCalendar1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadCalendar1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManagerProxy>

i want to register an event for radAjaxManager present in web page as below

        RadAjaxManager AjaxManager = (RadAjaxManager)this.Parent.FindControl("radAjaxManager");
        AjaxManager.ClientEvents.OnRequestStart = "RadAjaxManager1_AjaxRequest";


my event is like below and i want this event to be present in .cs file of user control..

  protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        if (e.Argument == "focusSelectedDate" && RadCalendar1.SelectedDates.Count > 0)
        {
            RadCalendar1.FocusedDate = RadCalendar1.SelectedDates[0].Date;
        }
        else if (e.Argument == "focusSelectedDate")
        {
            RadCalendar1.FocusedDate = DateTime.Now;
        }
    }

but still it is not able to find RadAjaxManager1_AjaxRequest event.. am i doing any thing wrong?

-Pramodh

  
Maria Ilieva
Telerik team
 answered on 27 Oct 2010
3 answers
52 views
Hi,

I am using RAd Editor on MVC Application.
All seems fine but I get the following error when I try to submit the page
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

I have looked around for the solution and tried all possible solution but nothing seems to work.

Can anyone please suggest how to work around this problem?
Rumen
Telerik team
 answered on 27 Oct 2010
1 answer
163 views
I have three rad windows in a rad window manager on my main page. I'd like the user to be able to make a selection in one window, then after clicking a button to close that window I'd like the second window containe din the window manager on the main page to open.

I tried using the OnClientClose event to call the other window but it's not working:

<telerik:RadWindowManager runat="server" ID="windowManager" Modal="true">
      
     <Windows>
         <telerik:RadWindow ID="main" runat="server" Modal="true" NavigateUrl="mainUp.aspx" VisibleOnPageLoad="true" OnClientClose="openWindow()">
         </telerik:RadWindow>
         <telerik:RadWindow ID="second" runat="server" Modal="true" NavigateUrl="scope.aspx">
         </telerik:RadWindow>
         <telerik:RadWindow ID="third" runat="server" Modal="true">
         </telerik:RadWindow>
     </Windows>
 </telerik:RadWindowManager>
 and here's my javascript:
function openWindow() {
    var oWnd = radopen(null, "second");
}
When the default page opens the "main" rad window, the user can click a button which fires this and closes that window:
function CloseOnReload() {
     GetRadWindow().Close();
      
 }
That closes the window, but how can I then get the "second" rad window to open? I tried inserting "var ownd = radopen(null, 'second') in the above CLoseOnReload function but nothing happens.
Georgi Tunev
Telerik team
 answered on 27 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?