Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
108 views
I have a RadGrid on my page displaying a list of search results from my database. Some of these results have associated files which I provide a download link for, and some don't.

For the results that don't have an associated file I want to hide the link in that row only. I can do that, I've found, using this code in the ItemDataBound event:

if (e.Item is Telerik.Web.UI.GridDataItem)
{
    if (!((bool)((DataRowView)e.Item.DataItem).Row["IsElectronic"]))
    {
        ((Telerik.Web.UI.GridDataItem)e.Item)["colDownload"].Visible = false;
    }
}

The problem is that by setting the GridDataItem's Visible property I'm effectively collapsing that column for that row, moving everything out of alignment with the grid headers. Instead, I'd like to do something to empty the contents of the cell, or change just that cell to a different column type, or something similar?
Adrian
Top achievements
Rank 1
 answered on 03 Jun 2014
2 answers
210 views
Hi, how do I get a handle to the RadDatePicker, within the context of a div.
my code snippet looks like this:
                    <div id="div123">
                      <telerik:RadDatePicker ID="txtSomeDate" runat="server" CausesValidation="True">
                      </telerik:RadDatePicker>
                    </div>

The command :
var somedate = $find("<%=txtSomeDate.ClientID %>");
returns me the datepicker.

However, I have a requirement where I need to get a handle to this datepicker which is within the div "div123" only.
This is because I have this datepicker within a user control and this user control could be embedded multiple times in the same page.

I tried $find("<%=txtSomeDate.ClientID %>",div123) but it returns null.

Any clues on how to get this working?

Thanks
Suchitra
 




Suchitra
Top achievements
Rank 1
 answered on 03 Jun 2014
7 answers
180 views
Hi I want to extend RadAsyncUpload control to meet our
custom validation need. However, I am experiencing two issues here.

1.  RadAsyncUpload contains two controls, one is
textbox and other is a button to invoke file explorer. However, to show error
how can I only target the textbox and not the button? Say for example, I want
to change only textbox border color when its invalid (and not the button)

 

2.  In extended control’s PreRender,  when I change CssClass attribute of the
control  if control is invalid, the change doesn't reflect on the control, but when I change the CssClass attribute before
the condition (if valid), the change takes effect. So looks like I can’t change the style
attribute after first load, which is very strange. However, I am not sure why
this is happening

Hope someone can help me with this.

Thanks
Shinu
Top achievements
Rank 2
 answered on 03 Jun 2014
5 answers
256 views
Hi,

When i add a field  programmatically:

Button1_Click:

PivotGridColumnField _row = new PivotGridColumnField();
_row.DataField = "[Account].[Accounts]";
_row.UniqueName = "[Account].[Accounts]";
this.RadPivotGrid1.Fields.Add(_row);

when i interact with him, it raises an error:

Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Value cannot be null.
Parameter name: fieldInfo

what is the issue ?

sorry my poor english.
AlefSan
Top achievements
Rank 1
 answered on 02 Jun 2014
3 answers
232 views
I am trying to get a site to work with a free screen reader (NVDA). I am making the fields more accessable by setting the AssociatedControlID of the asp:Labels to the associated fields. This technique works well for RadTextBoxes, but so far, it has not worked (NVDA will not read the label when the focus is on field) for any RadComboBoxes. Here is what the label / RadComboBox combo looks like:

<asp:Label ID="lblPAddrPreStreetDir" runat="server" EnableViewState="False" meta:resourcekey="lblPAddrPreStreetDirResource1" Text="Pre-Street <br>Direction:" AssociatedControlID="ddlPPreStDir"></asp:Label>

<telerik:RadComboBox ID="ddlPPreStDir" runat="server" AutoCompleteMode="SuggestAppend" DropDownStyle="DropDownList" meta:resourcekey="ddlPPreStDirResource1" TabIndex="2" Width="100px" CausesValidation="False" MarkFirstMatch="True">
                                                <Items>
                                                    <telerik:RadComboBoxItem meta:resourcekey="ListItemResource1" Text="None" runat="server"></telerik:RadComboBoxItem>
                                                    <telerik:RadComboBoxItem meta:resourcekey="ListItemResource2" Text="EAST" Value="E" runat="server"></telerik:RadComboBoxItem>
                                                    <telerik:RadComboBoxItem meta:resourcekey="ListItemResource3" Text="NORTH" Value="N" runat="server"></telerik:RadComboBoxItem>
                                                    <telerik:RadComboBoxItem meta:resourcekey="ListItemResource4" Text="NORTH EAST" Value="NE" runat="server"></telerik:RadComboBoxItem>
                                                    <telerik:RadComboBoxItem meta:resourcekey="ListItemResource5" Text="NORTH WEST" Value="NW" runat="server"></telerik:RadComboBoxItem>
                                                    <telerik:RadComboBoxItem meta:resourcekey="ListItemResource6" Text="SOUTH" Value="S" runat="server"></telerik:RadComboBoxItem>
                                                    <telerik:RadComboBoxItem meta:resourcekey="ListItemResource7" Text="SOUTH EAST" Value="SE" runat="server"></telerik:RadComboBoxItem>
                                                    <telerik:RadComboBoxItem meta:resourcekey="ListItemResource8" Text="SOUTH WEST" Value="SW" runat="server"></telerik:RadComboBoxItem>
                                                    <telerik:RadComboBoxItem meta:resourcekey="ListItemResource9" Text="WEST" Value="W" runat="server"></telerik:RadComboBoxItem>
                                                </Items>
                                            </telerik:RadComboBox>
Dimitar Terziev
Telerik team
 answered on 02 Jun 2014
3 answers
116 views
I followed the instructions here to auto resize my columns, but this doesn't appear to work if ShowHeader = false.  

http://www.telerik.com/help/aspnet-ajax/grid-gridcolumn-resizetofit.html.  

If ShowHeader = false, it looks like it resizes the columns so that the whole table is 100% of the screen, ore maybe even a bit more.  Is there a workaround for this?  Could I hide the header row on the client side after running resizeToFit()?


Jarod
Top achievements
Rank 1
 answered on 02 Jun 2014
2 answers
260 views
i use RadMediaPlayer in my project and i want in playlist add both audio and video. my code is: SqlConnection con = new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["conection"].ConnectionString);
SqlCommand cmd = new SqlCommand("SELECT Extension,Detail,Link,Title,Folder,Pic FROM [TblQuality] WHERE mId=@mId", con);
cmd.Parameters.AddWithValue("@mId", QSi);
SqlDataReader dr;
MediaPlayerFile file;
using (con)
{
con.Open();
dr = cmd.ExecuteReader();
while (dr.Read())
{
if (!dr.GetString(2).ToLower().EndsWith(".rar") || !dr.GetString(2).ToLower().EndsWith(".zip"))
{
//new media
if (dr.GetString(2).ToLower().EndsWith(".mp3"))
{
file = new MediaPlayerAudioFile()
{
Poster = string.Format("~/Management/images/Music_img/{0}/{1}", dr.GetString(4), dr.GetString(5)),
Path = string.Format("~/Cnt/Music/{0}/{1}", dr.GetString(4), dr.GetString(2)),
Title = string.Format("{0}.{1} - {2}", dr.GetString(3), dr.GetString(0), dr.GetString(1))
};
RadMP1MusicDown.Playlist.Add(file);
}
else
{
file = new MediaPlayerVideoFile()
{
Poster = string.Format("~/Management/images/Music_img/{0}/{1}", dr.GetString(4), dr.GetString(5)),
Path = string.Format("~/Cnt/Music/{0}/{1}", dr.GetString(4), dr.GetString(2)),
Title = string.Format("{0}.{1} - {2}", dr.GetString(3), dr.GetString(0), dr.GetString(1))
};
RadMP1MusicDown.Playlist.Add(file);
}
}
}
dr.Close();
cmd.Cancel();
}but when load page, media play are only in audio mode or video mode.if first item is mp3 and second is mp4 when video play mediaplayer don't show video only play sound.can help me fix this?
-------------------------------------
hgh system MediaSpace
Konstantin Dikov
Telerik team
 answered on 02 Jun 2014
6 answers
274 views
Hi All,

I am using entitydatasource for bind the grid. it is working fine.
but i need to insert without primary key because our primary key id generated using oracle sequence. we have some auto created column using Trigger. but when i am trying to insert it is asking all columns.
how we can insert selected columns instead of all columns?
Please help ASAP. it is very urgent.

Thanks in Advance,
S.Dhamodharan.
Radoslav
Telerik team
 answered on 02 Jun 2014
5 answers
588 views

Hi,

getting the famous webform_initcallback error that I cannot possibly solve with your advise in this form or internet..

asp page

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication2.WebForm1" %>
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     
        <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
        </telerik:RadScriptManager>
        <br />
        <telerik:RadComboBox ID="RadComboBox1" Runat="server">
        </telerik:RadComboBox>
        <br />
     
    </div>
    </form>
</body>
</html>

No back end code...

error message

<!DOCTYPE html>
 
<head><title>
 
</title><link href="/WebResource.axd?d=b8adWYak0tImLef4A3fc9Z8_PHe8zKE0KBeii0SRRMrZL_rQKR3OpEAm8hUy-uv03lBksH755XDi7vSiZ89vE2Xm8yPpbVN8tgDpIGivYDQnNkR_vImJ98FznLpy2TKAt0SsnUx2PpsgZlfIGCOmNw2&t=635173547820000000" type="text/css" rel="stylesheet" class="Telerik_stylesheet" /><link href="/WebResource.axd?d=h0MkSn0fIoCPzk73lQFHIcHNbbdB7miPzq0lW5BCUc2QtaYhGg6oJBoMFR0wbWaB8UaxdZe3R9EyFVRK4ngG7EepI4EmV4tkPwQv3vgtmRmHTl8AEeJK5E0WCrCPbHzqJpTJv08DA_1P6x83siCLNOY_Sw2_VhZ4J8dyPVXyt-Q1&t=635173547820000000" type="text/css" rel="stylesheet" class="Telerik_stylesheet" /></head>
<body>
    <form method="post" action="WebForm1.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="RadScriptManager1_TSM" id="RadScriptManager1_TSM" value="" />
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="Tm5N149yuKmzXB/3B/Ftu2dBnyIRBLBAcvYw8KDmwRC/RfHfYVBiQgUN8ptL4eCcbTI1nKphaomYMnQpljB21sjXL0iRXqYJPSGxSyBRh83N5SX1V1/8v4/Ugrgz+N+zM/fOXegnUBVzVX2plp21ebPiA6udRabI2DvItsRdt2D/e2fNxfyi+dG9WdhoYu6zFnPqYpQOPi2ORTaMmuFz8BrZ4aDKbsHFslH9pwzhY5/5aPQcngfhwpBPqfartm35mbi5Oha7KTAL54PlE+5wd1yb9lKS0hWiuGM+fzehrownLdaZQCgCtgcnyh0t7s2el2150Y2QZzSbyUwPMncnpg==" />
</div>
 
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>
 
 
<script src="/WebResource.axd?d=pynGkmcFUV13He1Qd6_TZET-9_WfhWfl_XSuxoR-zJfEfiMeDl8e9dCAvy19aYDj4W7rFHhZMkA7EuwSPbjGhw2&t=635053916887951880" type="text/javascript"></script>
 
 
<script src="/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3abd2cc352-ff4f-463d-bb67-37f24bb2febd%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2013.3.1015.45%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a7a1d9c2d-6cf2-464f-9ad3-e479c730ac61%3a16e4e7cd%3af7645509%3a2003d0b8%3a24ee1bba%3af46195d3%3a1e771326%3a88144a7a%3aaa288e2d" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.');
//]]>
</script>
 
    <div>
     
        <script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('RadScriptManager1', 'form1', [], [], [], 90, '');
//]]>
</script>
 
        <br />
        <div id="RadComboBox1" class="RadComboBox RadComboBox_Default" style="width:160px;">
    <!-- 2013.3.1015.45 --><table summary="combobox" style="border-width:0;border-collapse:collapse;width:100%">
        <tr class="rcbReadOnly">
            <td class="rcbInputCell rcbInputCellLeft" style="width:100%;"><input name="RadComboBox1" type="text" class="rcbInput radPreventDecorate" id="RadComboBox1_Input" value="" readonly="readonly" /></td><td class="rcbArrowCell rcbArrowCellRight"><a id="RadComboBox1_Arrow" style="overflow: hidden;display: block;position: relative;outline: none;">select</a></td>
        </tr>
    </table><div class="rcbSlide" style="z-index:6000;"><div id="RadComboBox1_DropDown" class="RadComboBoxDropDown RadComboBoxDropDown_Default " style="display:none;"><div class="rcbScroll rcbWidth" style="width:100%;"></div></div></div><input id="RadComboBox1_ClientState" name="RadComboBox1_ClientState" type="hidden" />
</div>
        <br />
     
    </div>
     
 
<script type="text/javascript">
//<![CDATA[
 
WebForm_InitCallback();Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadComboBox, {"_dropDownWidth":0,"_height":0,"_skin":"Default","_uniqueId":"RadComboBox1","clientStateFieldID":"RadComboBox1_ClientState","collapseAnimation":"{\"duration\":450}","expandAnimation":"{\"duration\":450}","itemData":[],"localization":"{\"AllItemsCheckedString\":\"All items checked\",\"ItemsCheckedString\":\"items checked\",\"CheckAllString\":\"Check All\"}"}, null, null, $get("RadComboBox1"));
});
//]]>
</script>
</form>
</body>
<script type="text/javascript">window.__vwd_mapping_data={"map":[{"sourceFile":"~/WebForm1.aspx"}]};</script>
<!-- Visual Studio Browser Link -->
<script type="text/javascript" src="/__vwd/js/artery"></script>
<!-- End Browser Link -->
</html>
What am I missing?

Slav
Telerik team
 answered on 02 Jun 2014
9 answers
1.6K+ views
How can i hide the grid when grid is bound to a null collection?

If i set grid visibility to false on grid_NeedDataSource event then no data is displayed even next time when it is bound  with some valid data.
Protected Sub gridConsolidation_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles gridConsolidation.NeedDataSource
    'Get filtered object data whose functional and technical improvement recommended
    Dim filterExpression As String
    filterExpression = String.Format("Opportunity_Id = {0} and Recommendation_Type_Id In ({1})", ddlOpportunity.SelectedValue, _
                                     CType(RecommendationType.Consolidation, Integer))

'dtRecommendationInitiative is a datatable to be used as grid datasource
    Dim dt As DataTable = GetFilteredDataview(dtRecommendationInitiative, filterExpression)
    Dim dataCount As Integer = dt.Rows.Count
    gridConsolidation.VirtualItemCount = dataCount
    gridConsolidation.AllowCustomPaging = Not ShouldApplySortFilterOrGroup(gridConsolidation)
    gridConsolidation.DataSource = dt
 
    'If gridConsolidation.Items.Count > 0 Then
 
    '    divConsolidationGrid.Style.Value = "display:block"
    '    btnMergeToExisting.Visible = True
    '    btnMergeToNew.Visible = True
    '    btnSave.Enabled = True
    '    btnCancel.Enabled = True
    'Else
    '    divConsolidationGrid.Style.Value = "display:none"
    '    btnMergeToExisting.Visible = False
    '    btnMergeToNew.Visible = False
    '    btnSave.Enabled = False
    '    btnCancel.Enabled = False
    'End If
End Sub


Regrds,
Abhishek
Princy
Top achievements
Rank 2
 answered on 02 Jun 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?