Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
100 views
Hello,

Is there some documentation on the new buttons and the events associated with them?  Any tutorials on how to get exporting working from the ground up with the new buttons?  That would be very helpful right now.  I'm looking at videos created last year on grid exporting and I don't want to add this feature to the project until I know what I'm doing and if this old video still matches up with the newer releases.

Thanks for any help,
Heath
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 16 Nov 2009
0 answers
89 views
I have tried to get flash embeded in a master page and working but can't. When embeded in a plain aspx page the thing works flawlessly using <object> </object> tag. Any help to resolve this is welcomed.
bigrich legend
Top achievements
Rank 1
 asked on 16 Nov 2009
2 answers
140 views
  I have a page that supports dragging and dropping rows between two RadGrids.  Initially, this worked as expected, but I've now added a GridTemplateColumn to the tables, and now when I try to drag, it just selects the text within the column.  If I grab the row at the far left edge, it still selects the row and drags normally.

  Is there a way in this case to make the template column work the same way as other columns?

Thanks,
  Andrew
Andrew
Top achievements
Rank 1
 answered on 16 Nov 2009
0 answers
82 views
Hello,

I came in difficulties including mediaplayer in FireFox, I need to be able to click on start/stop buttons so I included javascript for this:

            <object id="Player" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"   
            standby="Loading Microsoft Windows Media Player components...">  
                <param name="URL" value=""/>  
                <param name="rate" value="1"/>  
                <param name="balance" value="0"/>  
                <param name="currentPosition" value="0"/>  
                <param name="defaultFrame" value=""/>  
                <param name="playCount" value="1"/>  
                <param name="autoStart" value="-1"/>  
                <param name="currentMarker" value="0"/>  
                <param name="invokeURLs" value="-1"/>  
                <param name="baseURL" value=""/>  
                <param name="volume" value="50"/>  
                <param name="mute" value="0"/>  
                <param name="uiMode" value="full"/>  
                <param name="stretchToFit" value="1"/>  
                <param name="windowlessVideo" value="0"/>  
                <param name="enabled" value="-1"/>  
                <param name="enableContextMenu" value="-1"/>  
                <param name="fullScreen" value="0"/>  
                <param name="SAMIStyle" value=""/>  
                <param name="SAMILang" value=""/>  
                <param name="SAMIFilename" value=""/>  
                <param name="captioningID" value=""/>  
                <param name="enableErrorDialogs" value="0"/>  
                <param name="_cx" value="11377"/>  
                <param name="_cy" value="11377"/>  
            </object> 
            <br /> 
            <br /> 
            <input onclick="PauseMe()" type="button" value="Pause" id="btnPause" />   
            <input onclick="StopMe()" type="button" value="Stop" id="btnStop" /> 
            <input onclick="FullScreen()" type="button" value="Full screen" id="FSBUTTON" /> 
            <br /> 
            <br /> 
            <div id="divState">Playstate:  
            </div> 
            <br /> 
            <br /> 
            <div id="divStatus">Status:  
            </div> 
            <br /> 
            <asp:Label id="Label2" Text="FULLSCREEN" runat="server" /><br /> 
    </div> 
</div> 
<telerik:RadCodeBlock id="CodeBlock1" runat="server">  
<script type="text/javascript">  
var g_bPaused = false; // To track pause button state;  
 
// Initialized states.  
function InitMDP()  
{  
    try  
    {  
        document.getElementById("btnPause").disabled = true;  
        document.getElementById("btnStop").disabled = true;  
        if (document.getElementById("Player").object.enabled )  
        {  
        document.getElementById("Player").uiMode = "none";  
        }  
        }  
    catch(ex) {  
        alert(ex);  
        if ( document.getElementById("Panel1") )  
            document.getElementById("Panel1").display=true;  
    }  
}  
 

I get an exception in InitMDP "Player" 'has not this property' (but it works in IE), even trying to delay its execution in codebehind using

        protected override void OnPreRender(EventArgs e)  
        {  
            string scriptString             = "InitMDP();";  
            if ( HasAjaxManager )  
            {  
                // We must execute this on end of page loading by browser  
                AjaxManager.ResponseScripts.Add(scriptString);  
            }  
            base.OnPreRender(e);  
        }  
 

I don't understand, am I stopped by some FF feature ?


Thanks for idea.

CS





CSurieux
Top achievements
Rank 2
 asked on 15 Nov 2009
1 answer
234 views
Hello,
I have a RadGrid that has it's columns programatically defined and initial data (via a dataset) loaded in the Page_Init event.  The RadGrid is created and the initial data is loaded correctly, however when I try to insert new data into the grid the initial data is lost.

Example:  The RadGrid is created with two columns and a data set with five rows of data.  When I click "Add record" to add "Paul, Allen" the original five rows of data are removed and only the newest record, e.g. "Paul, Allen" in this example, is retained when I need all six records.

I was using the following documentation as a guide to creating the RadGrid's columns in the code-behing, http://www.telerik.com/help/aspnet-ajax/grdchanginggridstructuredynamically.html, and as such I have set  EnableColumnViewState.  I am thinking this is part of the problem and I'm having trouble figuring out when and where to store the dataset to a Session or ViewState object.

<telerik:RadGrid ID="RadGrid1" runat="server" > 
    <MasterTableView> 
        <RowIndicatorColumn> 
            <HeaderStyle Width="20px" /> 
        </RowIndicatorColumn> 
        <ExpandCollapseColumn> 
            <HeaderStyle Width="20px" /> 
        </ExpandCollapseColumn> 
         <Columns> 
         </Columns> 
 
    </MasterTableView> 
    <ClientSettings AllowKeyboardNavigation="True"> 
        <Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="" /> 
    </ClientSettings> 
</telerik:RadGrid> 


Imports Microsoft.ApplicationBlocks.Data 
Imports System.Configuration 
Imports System.Data.SqlClient 
Imports System.Data 
Imports Telerik.Web.UI 
 
 
Partial Class Usercontrols_Grid 
    Inherits System.Web.UI.UserControl 
 
    Private _customDataSet As DataSet 
 
    
    Private Sub CreateGrid() 
        'RadGrid1.PageSize = 10 
        RadGrid1.AllowPaging = True 
        RadGrid1.AllowSorting = True 
        RadGrid1.GridLines = GridLines.None 
        RadGrid1.Width = Unit.Percentage(50) 
        RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric 
        RadGrid1.AutoGenerateColumns = False 
        RadGrid1.ShowStatusBar = False 
        RadGrid1.PageSize = 7 
 
        'RadGrid1.MasterTableView.Width = Unit.Percentage(100) 
        RadGrid1.MasterTableView.EnableColumnsViewState = False 
        RadGrid1.MasterTableView.PageSize = 5 
        RadGrid1.MasterTableView.EditMode = GridEditMode.PopUp 
        RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top 
        RadGrid1.MasterTableView.DataKeyNames = New String() {"CustomID"} 
        RadGrid1.MasterTableView.EditFormSettings.EditColumn.ButtonType = GridButtonColumnType.ImageButton 
        RadGrid1.MasterTableView.EditFormSettings.PopUpSettings.Modal = True 
 
        'RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadGrid1, RadGrid1) 
    End Sub 
 
    Private Sub CreateColumns() 
        Dim EditColumn As New GridEditCommandColumn 
        EditColumn.ButtonType = GridButtonColumnType.ImageButton 
        EditColumn.UniqueName = System.Guid.NewGuid.ToString 
 
        Dim DeleteColumn As New GridButtonColumn 
        DeleteColumn.ConfirmText = "Delete this row?" 
        DeleteColumn.ConfirmDialogType = GridConfirmDialogType.RadWindow 
        DeleteColumn.ConfirmTitle = "Delete" 
        DeleteColumn.ButtonType = GridButtonColumnType.ImageButton 
        DeleteColumn.CommandName = "Delete" 
        DeleteColumn.Text = "Delete" 
        DeleteColumn.UniqueName = "DeleteColumn" 
        DeleteColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center 
 
 
        With RadGrid1.MasterTableView.Columns 
            .Add(EditColumn) 
            If Not IsNothing(_customDataSet) Then 
                For Each dc As DataColumn In _customDataSet.Tables(0).Columns 
                    Dim NewColumn = GetGridColumnType(dc.DataType.ToString) 
NewColumn.GetType.ToString) 
 
                    'Dim NewColumn As New GridBoundColumn 
                    NewColumn.DataField = dc.ColumnName 
                    NewColumn.HeaderText = dc.ColumnName 
                    If dc.ColumnName <> "CustomID" Then 
                        .Add(NewColumn) 
                    End If 
                Next 
            End If 
            .Add(DeleteColumn) 
        End With 
 
    End Sub 
 
    Private Property GridSource() As DataSet 
        Get 
            Dim obj As Object = Me.ViewState("_gds") 
            If (Not (obj) Is Nothing) Then 
                Return CType(obj, DataSet) 
            Else 
                _customDataSet = CreateDataSetStructure() 
                Me.ViewState("_gds") = _customDataSet 
                Return _customDataSet 
            End If 
        End Get 
        Set(ByVal value As DataSet) 
            Me.ViewState("_gds") = value 
            _customDataSet = value 
        End Set 
    End Property 
 
    
     'Created initial data set 
    Private Function CreateDataSetStructure() As DataSet 
     'Internals removed for posting as this part works fine to load the initial data set structure 
 
        Return CustomDataSet 
 
    End Function 
 
    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init 
        RadGrid1.DataSource = GridSource 
        CreateGrid() 
        CreateColumns() 
    End Sub 
 
     
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
  
    End Sub 
 
 
 
    Protected Sub RadGrid1_InsertCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.InsertCommand 
        Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem) 
        Dim editMan As GridEditManager = editedItem.EditManager 
 
        Dim CustomTable As DataTable = GridSource.Tables(0) 
        Dim NewRow As DataRow 
        NewRow = CustomTable.NewRow() 
 
        'Set new values 
        Dim column As GridColumn 
        For Each column In e.Item.OwnerTableView.Columns 
            If TypeOf column Is IGridEditableColumn Then 
                Dim editableCol As IGridEditableColumn = CType(column, IGridEditableColumn) 
 
                If (editableCol.IsEditable) Then 
                    Dim editor As IGridColumnEditor = editMan.GetColumnEditor(editableCol) 
                    Dim editorText As String = "Unknown" 
                    Dim editorValue As Object = Nothing 
                    If (TypeOf editor Is GridTextColumnEditor) Then 
                        editorText = CType(editor, GridTextColumnEditor).Text 
                        editorValue = CType(editor, GridTextColumnEditor).Text 
                    End If 
                    If (TypeOf editor Is GridNumericColumnEditor) Then 
                        editorText = CType(editor, GridNumericColumnEditor).Text 
                        editorValue = CType(editor, GridNumericColumnEditor).Text 
                    End If 
                    If (TypeOf editor Is GridDateTimeColumnEditor) Then 
                        editorText = CType(editor, GridDateTimeColumnEditor).Text 
                        editorValue = CType(editor, GridDateTimeColumnEditor).Text 
                    End If 
                    If (TypeOf editor Is GridBoolColumnEditor) Then 
                        editorText = CType(editor, GridBoolColumnEditor).Value.ToString() 
                        editorValue = CType(editor, GridBoolColumnEditor).Value 
                    End If 
                    If (TypeOf editor Is GridDropDownColumnEditor) Then 
                        editorText = CType(editor, GridDropDownColumnEditor).SelectedText + "; " + CType(editor, GridDropDownColumnEditor).SelectedValue 
                        editorValue = CType(editor, GridDropDownColumnEditor).SelectedValue 
                    End If 
                    Try 
                        newRow(column.UniqueName) = editorValue 
                    Catch ex As Exception 
                        'Label1.Text = (Label1.Text + ("Unable to insert. Reason: " + ex.Message)) 
                        e.Canceled = True 
                    End Try 
                End If 
            End If 
        Next 
 
        '_customDataSet.AcceptChanges() 
 
 
        CustomTable.Rows.Add(NewRow) 
        Me.GridSource.AcceptChanges() 
        Me.ViewState("_gds") = GridSource 
 
 
        'CustomTable.AcceptChanges() 
 
    End Sub 
End Class 
 


jgill
Top achievements
Rank 1
 answered on 15 Nov 2009
3 answers
126 views
Hello,
I have a RadComboBox in the Edit Form Template. On edit, I have to load data in it, but I can't find the the control.
Anyone with the solution !!!!

Regards,

Talha Majeed
Talha
Top achievements
Rank 2
 answered on 14 Nov 2009
0 answers
167 views
Hi, is there a way to disable tab key during editmodes = design?

Thanks in advance,
RJ
RJ
Top achievements
Rank 1
 asked on 14 Nov 2009
2 answers
105 views
I'm getting a strange design-time error viewing a RADGrid in VS2008. I've attached a image of the error window. It was working fine and something I did recently caused this but I can't nail it down. What could cause this error?

Thanks,
Bob
arnaud
Top achievements
Rank 1
 answered on 14 Nov 2009
9 answers
324 views
Hi guys

I have gone though the help section how to  access rows and columns  to do this but all key returns is '&nbsp;' The table has data and is populating that column with data. Any Ideas what I am doing wrong?

 <telerik:GridBoundColumn DataField="Tariff ID" HeaderText="Tariff ID" 
                                    SortExpression="Tariff ID" UniqueName="TariffID">
                                </telerik:GridBoundColumn>
and in code
Protected Sub RadGridMain_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles RadGridMain.ItemCreated
If TypeOf e.Item Is GridDataItem Then
            Dim dataItem As GridDataItem = CType(e.Item, GridDataItem)
            Dim key As String = dataItem("TariffID").Text
....
....


          
Steve Napurano
Top achievements
Rank 1
 answered on 14 Nov 2009
2 answers
137 views
Ok, so I would like this panel bar to be built and use a data source but the problem is that I use 3 tables for the source.

I have

  tblCategory
-cID                    Auto
-cName              String
-cDescription     String
-isDeleted          Boolean

  tblProducts
-pID                   Auto
-pNumber          String
-pName             String
-isDeleted         Boolean

and because products can be listed under multiple categories I have an intermediate table called

  tblInfo
-iID      Integer
-cID     Integer
-pID     Integer

Now I have created a table adaptor I call Navigation which loads like ...
SELECT        c.cID, c.cName, c.cDescription, p.pID, p.pNumber, p.pName
FROM            ((tblCategories c INNER JOIN
                         tblInfo i ON c.cID = i.cID) INNER JOIN
                         tblProducts p ON i.pID = p.pID)
WHERE        (c.isDeleted = False) AND (p.isDeleted = False)
ORDER BY c.cOrder, p.pName

so I have

-cID
-cName
-cDescriptino
-pID
-pNumber
-pName

and what I would like is for all the products to be listed under the categories.  Below is a sampling output of the table.

2 Skin Cleansers d 25 311 C-Mollient Gel Cleanser
2 Skin Cleansers d 20 043 LactiCleanse Creamy
2 Skin Cleansers d 21 243 LactiCleanse Foamy
2 Skin Cleansers d 22 247 Multi HA Cleanser
2 Skin Cleansers d 19 248 NeutraCleanse
2 Skin Cleansers d 23 286 RosaCleanse Creamy
2 Skin Cleansers d 24 287 RosaCleanse Foamy
3 Anti-Photoaging Anti Photo Aging 8 270 CEGA 30+FERULIC Cream
3 Anti-Photoaging Anti Photo Aging 3 269 CEGA 30+FERULIC Serum
3 Anti-Photoaging Anti Photo Aging 4 205 CEGA Eye Area
3 Anti-Photoaging Anti Photo Aging 32 206 C-Mollient Serum
3 Anti-Photoaging Anti Photo Aging 27 212 C-mollient

But when I try to specify 2 as the parent and pID as the child it gives me errors..

[ArgumentException: These columns don't currently have unique values.]

any help would be greatly appreciated.



Robert Gouin
Top achievements
Rank 1
 answered on 14 Nov 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?