Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
230 views
i have a telerik radbutton. on its client clicked a javascript method is called.

 <telerik:RadButton ID="btnOk" runat="server"  OnClientClicked="OK_Clicked" Text="Ok">                       
                    </telerik:RadButton>

//Javascript method
 function OK_Clicked()
 {        
//How can i get the the text value of the radbutton on which clientcliked event this method is called.
    }
Jayesh Goyani
Top achievements
Rank 2
 answered on 27 Aug 2011
12 answers
343 views
Hi,

 I am trying to create this http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx

100% programmatically.

Can anyone help please?

Thank you!

Dean
Jayesh Goyani
Top achievements
Rank 2
 answered on 27 Aug 2011
0 answers
85 views
Hi,
i am D.Srinivasa,

                       in my project i have a RadGrid to Display a Data from the DataBase, in my RadGrid i have a RadDatePicker Control to display a date from backend,  here enabled the maximum date condition in Raddatepicker,

the following coding is the condition for maximum date operation in RadDatePicker, it checks whether the database can have the data or not, if data is available then it sets the maximum date to that RadDatePicker,

some times it works perfectly but some times it returns error.. 

it returns an error is Specified Cast in Not Valid..

Code Is : 

<telerik:GridTemplateColumn UniqueName="gridActStart" HeaderText="Actual Start" AllowFiltering="false" ItemStyle-HorizontalAlign="Center"><br>
 <
ItemTemplate><br>                      
 <
telerik:RadDatePicker ID="actstart" runat="server" MaxDate='<%#If((Eval("early_start_display") IsNot DBNull.Value), Convert.ToDateTime(Eval("early_start_display")), CType("10/10/2011", System.Nullable(Of DateTime))) %>' Width="100px" Calendar-ShowOtherMonthsDays="false" Calendar-ShowRowHeaders="false" DbSelectedDate='<%# Bind("actual_start") %>' DateInput-DateFormat="MM/dd/yyyy">                     
</
telerik:RadDatePicker><br>                       
</
ItemTemplate><br>                   
 </
telerik:GridTemplateColumn>

and the following attachment is the database for my application. How to resolve this problem,
D.SRINIVASA
Top achievements
Rank 2
 asked on 27 Aug 2011
17 answers
1.8K+ views
I saw a post in Todd Anglin's blog from September about how to format output (font size, etc) of a grid export to PDF.  But I tried the suggestion and the suggested code had no effect on the output.  Is there anywhere I can go for a better discussion of this?
Jorge
Top achievements
Rank 1
 answered on 27 Aug 2011
1 answer
122 views

Hi,
   I have just started using the Telerik controls recently had a question which was frustrating me. I have a grid with a popup edit form. Inside the edit form I want to certain table rows depending on if the user clicks a button. I have registered the Jquery library in my masterpage already, and when i click the button the change happens only for a second then dissapears and the original rows are back. How can I persist the jquery change im trying to make? I even tried with an html button but it still does the same thing.  There has to be a way to do simple functions like hide/show table rows, can someone point that out please look below. This is the table in the Edit pop up form and down below is the Radcodeblock with the javascript. Thanks in advance!

 
<table id="tblEditPopup" style="width:100%; height:100%"
  
<tr id="trProduct"
  
<td align="right"
Select Product:
</td
<td
<telerik:RadComboBox ID="cboxCustomers" runat="server" AutoPostBack="true"
<Items
<telerik:RadComboBoxItem Text="Select Product" /> 
   
<telerik:RadComboBoxItem Text="Apple" Value="Apple" /> 
  
<telerik:RadComboBoxItem Text="Bananas" Value="Bananas" /> 
</Items
</telerik:RadComboBox
</td
</tr>
  
<tr id="trService" style="display:none"
<td align="right"
Select Service:
</td
<td
  
<telerik:RadComboBox ID="cboxServices" runat="server" AutoPostBack="true"
<Items
<telerik:RadComboBoxItem Text="Select Service" /> 
<telerik:RadComboBoxItem Text="Deliver Home" Value="Delivery" />
<telerik:RadComboBoxItem Text="Order By Mail" Value="Mail" /> 
</Items
<telerik:RadComboBox>
  
</td
</tr>
<tr>
<td>

<button id="BtnService" onclick="toggle()" >Choose Service</button>

</td>
</tr>
</table>
  
  
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
<script type="text/javascript"
  
function toggle() { 
    
$('#trProduct').css('display', 'none'); 
  
  
$('#trService').css('display', 'block'); 
}
  
</script
</telerik:RadCodeBlock
  
   
  
  
Farhan
Top achievements
Rank 1
 answered on 26 Aug 2011
1 answer
601 views
i have 6 charts in one page , everything works on my machine , but when i deploy the project to Server then i get "Specified cast is not valid" Error
the problem is just from one of the charts, when i remove it ,it work at the server too.
i put catch all around my code but i'm not getting any Exception even in the server. let me know if you need more data




Specified cast is not valid.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Specified cast is not valid.  

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidCastException: Specified cast is not valid.]
   System.Data.UnboxT`1.ValueField(Object value) +51
   System.Data.DataRowExtensions.Field(DataRow row, String columnName) +51
   ThinClient.DashBoard.WUC_Collection_Chart.<LinqDataSource_Collections_Selecting>b__2(DataRow Collect) +138
   System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +151
   System.Linq.<SkipIterator>d__4d`1.MoveNext() +86
   System.Linq.<TakeIterator>d__3a`1.MoveNext() +127
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +327
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +58

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +0
   System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +72
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +251
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +28
   System.Web.UI.WebControls.QueryableDataSourceHelper.ToList(IQueryable query, Type dataObjectType) +129
   System.Web.UI.WebControls.LinqDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +343
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +21
   Telerik.Web.UI.RadChart.PerformSelect() +159
   Telerik.Web.UI.RadChart.DataBind() +98
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66
   Telerik.Web.UI.RadChart.OnPreRender(EventArgs e) +22
   System.Web.UI.Control.PreRenderRecursiveInternal() +103
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1              

  
Ashim
Top achievements
Rank 1
 answered on 26 Aug 2011
3 answers
851 views

Hi,
I have a grid like following.....I have given only 1 column but there are 10 similar columns which comes from DB..similar in the sense it is rendered similar way this one column is shown below.
ASPX page.

 

 

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="true" Width="1080px" AutoGenerateColumns="false" GridLines="Both" Skin="XYZ" EnableEmbeddedSkins="false">

 

 

 

<MasterTableView Width="1063px" TableLayout="Fixed" ItemStyle-Font-Names="Arial" ItemStyle-Font-Size="11px" AlternatingItemStyle-Font-Size="11px" AlternatingItemStyle-Font-Names="Arial" HeaderStyle-Font-Names="Arial" HeaderStyle-Font-Size="11px" CommandItemDisplay="None">
<Columns>
<telerik:GridTemplateColumn HeaderText="Name" HeaderStyle-HorizontalAlign="Center" HeaderStyle-CssClass="rgcItemName" ItemStyle-CssClass="rgcItemName">

 

 

 

<ItemTemplate> <%#Container.DataItem("name").ToString%> </ItemTemplate> </telerik:GridTemplateColumn>

 

 

 

</Columns>

 

 

 

 

</MasterTableView>

 

 

 

<ClientSettings><Scrolling AllowScroll="true" UseStaticHeaders="true" /></ClientSettings>

 

</telerik:RadGrid>

 

 

 

</telerik:RadAjaxPanel>

 

VB Page

 

Protected Sub RadGrid1_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource

 

GetData()

 

End Sub

 

 

 

 

 

Protected

 

Function GetData() As Object

 

 

 

Dim table2 As New DataTable()

 

 

Dim XYZSql As String

 

 

 

XYZSql = ""

 

 

 

Dim XYZComm As New OracleCommand

 

 

Dim XYZConn As New OracleConnection(SQLConnStr)

 

 

Dim adapter As OracleDataAdapter = New OracleDataAdapter

 

adapter.SelectCommand =

New OracleCommand(XYZSql, XYZConn)

 

XYZConn.Open()

 

Try

 

 

 

adapter.Fill(table2)

 

RadGrid1.DataSource = table2

 

Catch ex As Exception

 

---

 

 

 

 

Finally

 

 

 

XYZConn.Close()

 

XYZConn.Dispose()

OracleConnection.ClearPool(XYZConn)

 

End Try

 

 

Return table2

 

 

End Function

 

 

 

On my Page Init Event all i am doing is RadGrid1.DataSource = Nothing like below code snippet shows. I am not calling Radgrid.ReBind(). But the Data still rebinds.

 

 

 

 

 

Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init

 

 

RadGrid1.DataSource = Nothing

 

End

 

Sub

 

WORKING CASE: Everything works fine so far...grid binds and sorts perfectly......

 

HOWEVER CASE: If i put Radgrid1.Rebind() after RadGrid1.DataSource = Nothing my grid does not sort in proper manner. If try to sort Col 1, col 3 sorts or col 2 sorts. I have no sorting event  other than AllowSorting=True in the aspx page. I absolutely dont have any columns to not be visible. Why Does it not sort well if i have Rebind() method called in Page Init.
I happen to read this topic in the link given below.....
http://www.telerik.com/help/aspnet/grid/grdcommandsthatinvokerebindimplicitly.html


Does NeedDataSource implicitly call Rebind method and sort the grid in WORKING CASE. Where does it store the data and binds it to the grid every time i sort the grid. Does it store in Hard Disc memory? If you are going to give me a link for sorting will it have an answer to the Question i just asked about where does it store the data to bind the grid again and again for each sorting. WORKING CASE does not have a direct call to Rebind.

In my HOWEVER CASE I am making an explicit call to Rebind(). Is it messing up the automatic sorting and the grid does not sort well?

References for Radgrid in Master page looks like.....
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

</telerik:RadAjaxManager>

 

Your answer will help me greatly
Vidya

Jayesh Goyani
Top achievements
Rank 2
 answered on 26 Aug 2011
3 answers
95 views
I am trying to display a grid with 3 columns. 2 of the columns are updateable. The problem I am having is when the client does a batch update, I dont want to update every record from the grid to the database. I only want to process just the changed records/cells. It is almost like a hybrid Excel grid project demo and the Telerik ClientEditBatchUpdates demo. I dont want the user to have to click edit on every row so that is why I am using the Excel like demo. Anyone have any experience with this?
Jayesh Goyani
Top achievements
Rank 2
 answered on 26 Aug 2011
1 answer
108 views
Below is a code snippit I found in one of your forums.  It was working fine until I turned on filtering.  Now "id" in gridHeader.childNodes[i].id is null so it fails on ".indexOf".   


function BulkOperationRadGrid_GridCreated(sender, eventArgs) {
    var masterTable = sender.get_masterTableView();
    //check whether all items on the active page are selected    
    if (masterTable.get_selectedItems().length == masterTable.get_pageSize()) {
        /*find the checkbox in the header of the GridClientSelectColumn and set checked state for it - will work with AllowMultiRowSelection = true only!*/
        var gridHeader = masterTable.get_element().getElementsByTagName("TH")[0];
        for (var i = 0; i < gridHeader.childNodes.length; i++) {
            if (gridHeader.childNodes[i].id.indexOf("columnSelectCheckBox") > -1) {
                gridHeader.childNodes[i].checked = "true";
            }
        }
    }
Jayesh Goyani
Top achievements
Rank 2
 answered on 26 Aug 2011
1 answer
132 views
Hi,

Can you tell me how to change the selectedrow color of a rad grid?  I tried changing the selected row forecolor to green but If you look at the attached photo I provided you will see where it is just sitting below the gray background. This is strange...can you take a look at the example I provided?

Thanks,
Ron.
Jayesh Goyani
Top achievements
Rank 2
 answered on 26 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?