Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
101 views
is posible to display an user control in popup mode when i click edit, and another when i click insert, or another when i click some command else???
Princy
Top achievements
Rank 2
 answered on 06 Oct 2009
3 answers
131 views
Hi,

I have a radgrid with a combobox field. I am following the example set out here:
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/comboingrid/defaultcs.aspx?product=grid

I have changed this example to be driven off code behind. I am trying to also update the backend sql tables from the codebehind by using OnUpdateCommand="RadGridFieldMappings_UpdateCommand". The issue is that I dont know how to get the value to the selected combox item in the code behind to then update the sql tables.  Please help!

Main ASPX page / radgrid code here.
       <telerik:radgrid id="RadGridFieldMappings" runat="server" 
            AutoGenerateColumns"False"  
            AllowSorting="True"  
            AllowPaging="True" 
            OnNeedDataSource="RadGridFieldMappings_NeedDataSource" 
            OnDataBound = "RadGridFieldMappings_DataBound" 
            OnUpdateCommand="RadGridFieldMappings_UpdateCommand" 
            AllowAutomaticUpdates="true" 
            PageSize="15" 
            GridLines="Both" 
            Height="300px" 
           > 
           <MasterTableView ShowFooter="false" DataKeyNames="ID" EditMode="InPlace"
               <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle> 
              <Columns> 
                  <telerik:GridNumericColumn DataField="ID" UniqueName="ID" HeaderText="ID" Visible="false" ReadOnly="True"/> 
                    
                  <telerik:GridBoundColumn UniqueName="ListID" HeaderText="ListID" DataField="ListID" Visible="false" ReadOnly="True"
                     <HeaderStyle Width="40px"></HeaderStyle> 
                    </telerik:GridBoundColumn> 
                                  
                    <telerik:GridBoundColumn UniqueName="ListName"  HeaderText="List Name" DataField="ListName" ReadOnly="True"
                    <HeaderStyle Width="155px"></HeaderStyle> 
                    </telerik:GridBoundColumn> 
                     
                    <telerik:GridBoundColumn UniqueName="FieldName" HeaderText="FieldName" DataField="FieldName" ReadOnly="True"
                     <HeaderStyle Width="120px"></HeaderStyle> 
                    </telerik:GridBoundColumn> 
                    
                     <telerik:GridTemplateColumn  
                        UniqueName="DestFieldName"  
                        HeaderText="Destination Field" 
                        SortExpression="DestFieldName" 
                        Visible="true"
                        <FooterStyle VerticalAlign="Middle" HorizontalAlign="Center" /> 
                        <HeaderStyle Width="230px"></HeaderStyle> 
                        <ItemTemplate> 
                            <%#DataBinder.Eval(Container.DataItem, "DestFieldName")%> 
                        </ItemTemplate> 
                        <EditItemTemplate> 
                            <telerik:RadComboBox  
                              DataTextField="DestFieldName" 
                              DataValueField="DestFieldName" 
                              EnableLoadOnDemand="True" 
                              ID="RadComboBox1" 
                              runat="server" 
                              Height="140px" 
                              Width="220px" 
                                
                              DataSourceID="DestinationFields"
                            </telerik:RadComboBox> 
                        </EditItemTemplate> 
                    </telerik:GridTemplateColumn> 
                     
                    <telerik:GridEditCommandColumn FooterText="EditCommand footer" UniqueName="EditCommandColumn" 
                        HeaderText="Edit" HeaderStyle-Width="100px"
                    </telerik:GridEditCommandColumn> 
                     
              </Columns> 
           </MasterTableView> 
           <PagerStyle Mode="NumericPages"></PagerStyle> 
        </telerik:radgrid> 
         
         
        <asp:SqlDataSource ID="DestinationFields" runat="server" ConnectionString="<%$ ConnectionStrings:iBase_DM %>" 
            ProviderName="System.Data.SqlClient"  
             SelectCommand="SELECT FieldName as DestFieldName FROM DMProfileFieldMap WITH(NOLOCK)" > 
        </asp:SqlDataSource> 

Code Behind.

    Protected Sub RadGridFieldMappings_NeedDataSource(ByVal [source] As ObjectByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGridFieldMappings.NeedDataSource 
        GetUserDetails() 
        Try 
            Me.RadGridFieldMappings.ClientSettings.Scrolling.AllowScroll = True 
            Me.RadGridFieldMappings.ClientSettings.Scrolling.UseStaticHeaders = True 
            Me.RadGridFieldMappings.ShowHeader = True 
            Me.RadGridFieldMappings.ShowFooter = True 
            Me.RadGridFieldMappings.ClientSettings.Resizing.AllowColumnResize = True 
            Me.RadGridFieldMappings.ClientSettings.Resizing.AllowRowResize = False 
            Me.RadGridFieldMappings.ClientSettings.Resizing.EnableRealTimeResize = True 
            Me.RadGridFieldMappings.ClientSettings.Resizing.ResizeGridOnColumnResize = True 
            Me.RadGridFieldMappings.ClientSettings.Resizing.ClipCellContentOnResize = True 
            Me.RadGridFieldMappings.ClientSettings.AllowColumnsReorder = True 
            Me.RadGridFieldMappings.ClientSettings.ReorderColumnsOnClient = True 
 
            strSQL = "SELECT" & vbCrLf 
            strSQL += " l.ListName," & vbCrLf 
            strSQL += " l.ListID," & vbCrLf 
            strSQL += " lf.ID, " & vbCrLf 
            strSQL += " lf.EmailAddrField, " & vbCrLf 
            strSQL += " lf.FieldName, mdfm.DestFieldName" & vbCrLf 
            strSQL += "FROM " & vbCrLf 
            strSQL += " AppControl.Messages m WITH(NOLOCK) INNER JOIN " & vbCrLf 
            strSQL += " AppControl.MessageLists ml WITH(NOLOCK)" & vbCrLf 
            strSQL += "     ON m.TaskID = ml.TaskID INNER JOIN " & vbCrLf 
            strSQL += " AppControl.Lists l WITH(NOLOCK)" & vbCrLf 
            strSQL += "     ON ml.ListID = l.ListID INNER JOIN " & vbCrLf 
            strSQL += " AppControl.ListFields lf WITH(NOLOCK)" & vbCrLf 
            strSQL += "     ON l.ListID = lf.ListID LEFT JOIN" & vbCrLf 
            strSQL += " AppControl.MessageDeployFieldMappings mdfm WITH(NOLOCK)" & vbCrLf 
            strSQL += "     ON m.TaskId = mdfm.TaskID " & vbCrLf 
            strSQL += "     AND lf.ID = mdfm.ListFieldID " & vbCrLf 
            strSQL += "WHERE" & vbCrLf 
            strSQL += " m.TaskID = " & TaskID & " " & vbCrLf 
            strSQL += " AND ml.IncludeList = 1" & vbCrLf 
            strSQL += " AND LoadIntoDMList = 1" & vbCrLf 
            strSQL += " AND EmailAddrField <> 1" & vbCrLf 
            If iTargetLists = 1 Then 
                RadGridFieldMappings.DataSource = ReadRecordsTargetLists(strSQL) 
                iTargetLists += 1 
            Else 
                Exit Sub 
            End If 
        Catch ex As Exception 
            Response.Redirect("ErrorPage.aspx?ErrorPage=" & Server.UrlEncode(ThisPage) & "&Exception=" & Server.UrlEncode(ex.Message)) 
        End Try 
    End Sub 
 
    Protected Sub RadGridFieldMappings_UpdateCommand(ByVal source As ObjectByVal e As GridCommandEventArgs) 
        '?????????????????????????? 
    End Sub 

Im stumped on the following part. 
    Protected Sub RadGridFieldMappings_UpdateCommand(ByVal source As ObjectByVal e As GridCommandEventArgs) 
        '?????????????????????????? 
    End Sub 

Any help would be much appreciated.

thanks

Princy
Top achievements
Rank 2
 answered on 06 Oct 2009
3 answers
437 views
Hi there
i have a radgrid with Gridbuttoncolumn, i would like to execute a javascript code to check if i can delete this record. Is there a way to call a javascrip funtion first then execute the Delete comand 
 

<

 

telerik:GridButtonColumn ConfirmText="Delete this?" ConfirmDialogType="Classic" ConfirmTitle="Delete" ButtonType="ImageButton"

 

 

CommandName="Delete" Text="Delete" UniqueName="DeleteColumn"

Thanks
Tony

 

Princy
Top achievements
Rank 2
 answered on 06 Oct 2009
15 answers
231 views
Dear Sir,

I am using load-on-demand ( web service )...
is it possible to return null object in server-side and client-side doesn't throw a javascript error?


Akber Ali
Top achievements
Rank 1
 answered on 06 Oct 2009
2 answers
169 views
Hi,

I have a CheckBoxList inside FormTemplate (MasterTableViewEditForm) of a RadGrid.
I cannot find it using something like

RadGrid1.FindControl("controlID");

Any help is greatly appreciated.

han
Matt Johnston
Top achievements
Rank 1
 answered on 05 Oct 2009
0 answers
149 views
Hi, I've been trying to disable and hide controls of my Edit template but seems like I don't know all the instance name of the control. I was able to disable some of the controls like the description, startdate and enddate but other names are not correct when using it as instance name. Where can I find the list of instance names so that I can have it disabled and hidden. Also I was able to make use of the Starttime as an instance name but upon applying enabled = false, control still enabled..
-I want to hide save
-change text of cancel to close
-hide all day and recurring task
-disable timestart and timeend

Heres my code:
ASPX:
<telerik:RadScheduler ID="RadScheduler1" runat="server"  Width="950px" Height="480px" SelectedView="MonthView" DayStartTime="14:00:00" DayEndTime="23:59:00" 
            DataEndField="Sched_End" 
            DataKeyField="ID" DataRecurrenceField="RecurringInfo" DataRecurrenceParentKeyField="ParentID" 
            DataStartField="Sched_Start" DataSubjectField="Title" 
            HoursPanelTimeFormat="htt" ValidationGroup="RadScheduler1" ReadOnly="false" AllowDelete="false" AllowInsert="false">  
              
</telerik:RadScheduler> 

VB:

Protected Sub RadScheduler1_FormCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.SchedulerFormCreatedEventArgs) Handles RadScheduler1.FormCreated  
If e.Container.Mode = SchedulerFormMode.AdvancedEdit Then  
            Dim Description As TextBox = CType(e.Container.FindControl("Subject"), TextBox)  
            Dim startDate As RadDatePicker = CType(e.Container.FindControl("StartDate"), RadDatePicker)  
            Dim endDate As RadDatePicker = CType(e.Container.FindControl("EndDate"), RadDatePicker)  
            Dim startTime As RadTimePicker = CType(e.Container.FindControl("StartTime"), RadTimePicker)  
            Dim endTime As RadTimePicker = CType(e.Container.FindControl("EndTime"), RadTimePicker)  
 
            Description.Enabled = False 
            startDate.Enabled = False 
            endDate.Enabled = False 
            startTime.Enabled = False  'No error here but its not working  
            endTime.Enabled = False    'No error here but its not working  
 
 End If  
End Sub 

Thanks in advance,
RJ





 

RJ
Top achievements
Rank 1
 asked on 05 Oct 2009
2 answers
116 views
Hi.
Im running IE7.0 an Firefox 3.5, and im experiencing a WIERD problem. If I in plain notepad create a html-file and enter a lot of text inside a <font style="line-height:15px;font-family:verdana;font-size:10px"> A lot of text </font> i find that IE and firefox shows the text excactly alike.
If i copy this tag with its containing text into telerik for moss 4.5 the lineheight differs - quite a bit - firefox shows something like 18px while ie shows it as its supposed to.
Making a little experiment. en my offline local htm file - if i change line-height:15px, to line-height:0px both browsers shows all text lines on top of each other - only showing one single line (not very userfriendly though :-)
If i do the same in telerik rad editor for moss - ie still shows all lines in one while nothing happens in firefox. Why is this? and can i do anything about it?
As said, firefox and ie responds completely alike if the code is run outside telerik from a simple htmlfile only containing the font-tag and its contained text, but something happens to firefoxs interpretation of the style when created in telerik rad editor for moss.

could anyone plz help - this i a big showstopper for me... :-(

Regards
Per Hoyer Stensnaes
Top achievements
Rank 1
 answered on 05 Oct 2009
4 answers
161 views
I have ASP.NET 3.5 installed. I have extended the web.config for AJAX 3.5. Is there a way I can install just the RadEditor? We would like to install this first and then roll the controls out once our users are comfortable with the editor. Is there a way to disable to page content area editor being a radcontrol or radeditor? We want to just use the web part.

Thanks!
Adam P.
Kurt Sanders
Top achievements
Rank 1
 answered on 05 Oct 2009
2 answers
167 views
Hi there.

I was just trying to add a simple radalert to my aspx page that I call from my code behind upon successful completion of a task.

Here is the code I am executing from inside a button click handler:

 

string scriptstring = "radalert('Task information loaded successfully!', 330, 210);";

 

 

RadScriptManager.RegisterStartupScript(this, this.GetType(), "radalert", scriptstring, true);

When I execute the code, I get the following error:

Error: Object expected

When looking a the page source, the error is occurring on the first open tag here:

<script type="text/javascript">
//<![CDATA[
radalert('Task information loaded successfully!', 330, 210);Sys.Application.initialize();
Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadAjaxManager, {"_updatePanels":"","ajaxSettings":[],"clientEvents":{OnRequestStart:"",OnResponseEnd:""},"defaultLoadingPanelID":"","enableAJAX":true,"enableHistory":false,"links":[],"styles":[],"uniqueID":"ctl00$RadAjaxManager1","updatePanelsRenderMode":0}, null, null, $get("ctl00_RadAjaxManager1"));
});
Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadTabStrip, {"_selectedIndex":0,"_skin":"Default","clientStateFieldID":"ctl00_RadTabStrip1_ClientState","selectedIndexes":["0"],"tabData":[{},{},{},{},{}]}, null, null, $get("ctl00_RadTabStrip1"));
});
//]]>
</script>
</form>
</body>
</html>

I am probably missing something obvious. Any help provided would be much appreciated.

Mike

 

Michael Love
Top achievements
Rank 1
 answered on 05 Oct 2009
1 answer
79 views
I just need to delete a record from over  a RadGrid. I tried to setAllowAutomaticDeletes to  true and i inserted the following html into RadGrid's columns however nothing happened. What am i supposed to do  further? I am using LLBLGEN datasource in which there is no update/insert/delete query explicitly.

<telerik:GridButtonColumn ConfirmText="Delete this customer?" ButtonType="ImageButton"
                        CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                        <HeaderStyle Width="20px" />
                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                    </telerik:GridButtonColumn>

Pavlina
Telerik team
 answered on 05 Oct 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?