.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to set FrameworElement Control into Grid in UserControl

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :JQuery


How can I put controls into Grid in my UserControl in Designer when i use this control in Window?

View Complete Post

More Related Resource Links

Cutting Edge: A New Grid Control in Windows Forms


Grid controls are essential in many of today's apps. Until now, though, most developers using Visual Basic® have had to buy third-party components to get an effective, easy to use grid component. The Windows® Forms DataGrid turned out to lack too many features for the average developer.

Dino Esposito

MSDN Magazine April 2005

UserControl with a control property?

Hi... I have defined a UserControl wich needs to reference another control like this: <ctrl:Cook TheList="listView1" DefaultFileName="MyRecipe"></ctrl:Cook> The code behind of the control has the property defined:         public ListView TheList { get; set; } But I have a runtime error saying: 'ListView' type does not have a public TypeConverter class. And in design time I get: Property TheList of type ListView cannot be specified as string.   I know WPF is trying to read a string instead of a ListView, but dont know the magic solution. Maybe a converter? Please suggest the simpler solution you can, because this is not a vital requirement on the app. Thanks in advance for any help  

How to set Panel.Zindex value though XAML code if any of the Grid/UserControl children having the fo

Hi, I have a Grid with 10 buttons. If any of these buttons has focus then I want to set the Panel.Zindex = 999 for the Grid. How to do this in XAML code?Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This will help other members to find the solution easily.

Grid control displays a hyperlink. (in WPF)

Hello, I'm making application, that's received a text from web.   get the text following the code is shown below.   For Each Status As Status In A.GetList grdList.RowDefinitions.Add(New RowDefinition() With {.Height = GridLength.Auto}) Dim TextBlock As New TextBlock() TextBlock.Margin = New Thickness(4) TextBlock.TextWrapping = TextWrapping.Wrap TextBlock.Inlines.Add(Status.Text) Grid.SetColumn(TexatBlock, 1) Grid.SetRow(TextBlock, grdList.RowDefinitions.Count - 1) grdList.Children.Add(TextBlock) Next TextBlock is added, the grid view control does not display a hyperlink. So, Does not display the URL as a hyperlink. What should I do in the grid control will display the URL as a hyperlink? plz, help me

Ajax control with usercontrol

Hi all, Can I point some properties (like targetcontrolid and CancelControlID) from ajax controls to a panel that is in a usercontrol file ? For example: aspx file<asp:modalpopupextender id="mpeRegistroAlterado" runat="server" TargetControlID="cmdInvisible" CancelControlID="cmdClose" popupcontrolid="Panel_Msgbox_Timestamp" popupdraghandlecontrolid="PopupHeader2" backgroundcssclass="Fundo_Ao_Exibir_Painel" > </asp:modalpopupextender> ascx file<asp:Button ID="cmdInvisible" runat="server" Text="Button" CssClass="Esconde" /> <asp:panel id="Panel_Msgbox_Timestamp" style="display: none" runat="server"> <div class="Div_Painel_MSGBOX"> <div id="PopupHeader2" class="Div_Painel_MSGBOX_Cabecalho">System</div> <div class="Div_Panel_MSGBOX_Body"> <br /> <br /> Message.<br /> <br /> <br />   </div> <div class="Div_Painel_MSGBOX_Buttons"> <input id="cmdclose" type="button" value="Close&q

Access UserControl Control from a JavaScript Function

I have a requirement to launch a Modal Javascript dialog box from within my usercontrol,I have done this by <code> function browseControlAction(ProjID,ControlID) { strPrompt = 'Select a Previous control action..'; strOptions = 'dialogWidth:25;dialogHeight:30;status:no;resizable:yes'; selectedAction = window.showModalDialog('browseControlActions.aspx?ProjID=' + ProjID + '&Control=' + ControlID, strPrompt, strOptions); var sControl = ' + ControlID + '; if (selectedAction != null) { alert(ControlID.toString()); alert(selectedAction); var sTest = ControlID + '_txtControlAction'; alert(sTest); var sTest2 = 'txtSummary'; alert(sTest2); document.getElementById('txtCurrentControls').innerText=selectedAction;   //this works as this a control on the page itself document.getElementById(sTest2).innerText=selectedAction;      //Ditto document.getElementById(sTest).innerText=selectedAction;    //This Fails as this is the control in the USercontrol I am trying to Access //__doPostBack('',''); }</code>can anybody tell me why I can't access the Textbox control on the USercontrol?

Unable to store combo box value to data grid view control

Hello,         I am using fw 3.5 SP1 with VS2008. I have bind my object collection with data grid view. I can see different values in combo box inside data grid view. But when I select any one value from combo box the selected value is changed to first value of combo box as soos as user leave the cell of the gird. Can anyone tell me where should I look for this problem so that my selected value remains same as user did select it.   Nilkanth Desai  

Grid view control problem

HiI am using the grid view control where i am using <asp:CommandField for editing & deleting i want to visible false of this coloumn with edit & delete button..how do this.Thanks<asp:GridView DataKeyNames="StaffCalendarId"  PagerSettings-Mode="NumericFirstLast"                                                        PagerStyle-HorizontalAlign="Center" ShowHeader="true" AllowPaging="true" AutoGenerateColumns="False"                                                        Width="100%" ID="gvEventInfo" runat="server" CellPadding="4" ForeColor="#333333"                            &nbs

Regarding Use Of Rad Grid Telerik control

I am using Telerik Rad Grid Control in my Sharepoint While creating Custom field type . I downloaded Telerik Rad Controls for ASP.Net AJAX Q2 2010 SP1.and put my telerik.web.config.UI in GAC .I added in web.configthe safe controls < SafeControl Assembly="Telerik.Web.UI, Version=2009.2.701.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TypeName="*" Safe="True" /> < SafeControl Assembly="Telerik.Web.UI, Version=2010.2.826.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.Design" TypeName="*" Safe="True" /> and in my .ascx file I added this thing: <% @ Register assembly="Telerik.Web.UI, Version=2010.1.309.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4"   namespace="Telerik.Web.UI" tagprefix="telerik" %> and I am getting this error please tell me where is tha problem .   File Not Found.   at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)    at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark

Trying to incorporate the use of a dropdown list control with a grid view control


I'm trying to setup a page that will utilize a dropdown list control inside of a grid view control using VS 2005 2.0 version. Everything that I can find online seems to only show the use of the dropdown list control using a data grid. I don't want to use a data grid because it doesn't have the functionality/ power as the grid view control. Can someone please tell me how I can incorporate a dropdown list control with the grid view control? Here is a copy of my code.

<asp:GridView ID="HardwareSetdv" runat="server" AllowPaging="True"
        AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="AcctID"
            <asp:CommandField ShowSelectButton="True" />
            <asp:BoundField DataField="HardwareSetID" HeaderText="HardwareSetID"
                InsertVisible="False" ReadOnly="True" SortExpression=&quo

Nested control's events not firing in UserControl


Hello I have a weird issue. I have a user control which I load dynamically using LoadControl. In this UserControl I have a button with assigned OnClick event, but when I click that button, the event is not fired. I'm populating the user control in UpdatePanel's Load event (I invoke __dopostback from JS).

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ServiceInput.ascx.cs"
Inherits="uPay.UserControls.ServiceInputs.ServiceInput" ViewStateMode="Disabled" %>
    <div class="PopupFoot">
        <asp:Button ID="btnAdd" CssClass="PopupADD" runat="server" OnClick="btnAdd_Click" />

    protected void btnAdd_Click(object sender, EventArgs e)
        //Method never gets called :/

 Here I load user control in the page

protected void ServicesUpdatePanel_Load(object sender, EventArgs e)
        string arg = Request.Params.Get("__EVENTARGUMENT");
        if (arg == "ServiceInput")
            int serviceId;
            if (Int32.TryParse(hdnSelectedService.Value, out serviceId))
                using (Entities db = new Entities())

In UserControl, FooCmdCanExecute (context menu) not called until after a control button is clicked.


I'm seeing an odd behavior I can't explain.  I am using a 3rd party control, and while it's possible it's an issue with that control, I wanted to inquire here to see if anyone has experienced similar behavior in other instances (unrelated to my particular 3rd party control).

I created a UserControl, comprising a ComponentONE chart and several buttons.  When the UserControl is given a data source (for the chart), it programmatically creates a ContextMenu that allows the user to configure the Y view extent for each of the data series provided in the data source.  After it's created, it's set as the ContextMenu for the chart.  The UserControl is used inside a tab on the app's main window, and is also plunked directly inside another window that can be brought up.

The UserControl defines a RoutedCommand - let's say FooCmd.  When the MenuItems for the context menu are created, their Command properties are set to FooCmd.  Also, a CommandBinding in the UserControl associates FooCmdCanExecute() and FooCmdExecuted() in the control class with the command.

The buttons in the UserControl are for data navigation - e.g. , there's one that moves the chart's "viewport" to the beginning of the data, and one for the "end".  The click handlers are not complex - essentially, they just set

problem in selecting deslecting multiple records in grid view by clicking control key.plz help


i want to select/deselect multiple records inside grid view by clicking control key.I can do the selection but the deselection is not working properly..there is some thing wrong in the  logic.plz help me to solve the problem.

my java script function is like..

<script language="javascript" type="text/javascript">

    function FillColor(cellid, id, evt) {
        var isSelected = document.getElementById('<%=hidSelectedRow.ClientID%>');
        if (!evt) var evt = window.event;
        ctrlPressed = evt.ctrlKey;
        if (!ctrlPressed) {
            var clearCellColor = document.getElementById('hidCellId').value.split(',');
            for (i = 0; i < clearCellColor.length; i++) {

HELP ! - how to disable spesific control inside the grid view



I need to disable the "Imagebuttons" after the user click on one of them... I've sucessfully updated the table when the user click on a button using the following code on the event of row command of the gridview...


if (e.CommandName == "voter_up")
            SqlCommand voteup = new SqlCommand("update arto_comments set voteup = voteup+1 where cid=" + e.CommandArgument, con);
            SqlCommand getVup = new SqlCommand("select voteup from arto_comments where cid =" + e.CommandArgument, con);
            //lblvoteup.Text = Convert.ToString(getVup.ExecuteScalar());
            //GridView1.Rows[1].FindControl("ImageButton1"). = false;
            ImageButton1.Enabled = false;

so please how may I disable these buttons after database is updated ?

Thanx and Regards

problem in selecting deslecting multiple records in grid view by clicking control key through java


i want to select/deselect multiple records inside grid view by clicking control key.I can do the selection but the deselection is not working properly..there is some thing wrong in the  logic.plz help me to solve the problem.

my java script function is like..

<script language="javascript" type="text/javascript">

    function FillColor(cellid, id, evt) {
        var isSelected = document.getElementById('<%=hidSelectedRow.ClientID%>');
        if (!evt) var evt = window.event;
        ctrlPressed = evt.ctrlKey;
        if (!ctrlPressed) {
            var clearCellColor = document.getElementById('hidCellId').value.split(',');
            for (i = 0; i < clearCellColor.length; i++) {

Problem merging toolstrip control placed in UserControl with MDI Form menu


I currently have an MDI application with a MenuStrip as Main Menu. The application has a child form where an instance of one UserControl with a MenuStrip is dynamically created when the form is loaded. The MenuStrip contained on this UserControl is correctly merged with the Menu of the MDI container. In response to a button click on the child form, an instance of another UserControl is created, containing a different Menu and the previously UserControl instance is discarded. The expected action is that the menu of the second UserControl will replace the menu of the first UserControl on the MDI container menu, but this is not happening and the main menu keeps the menu items of the first UserControl.

How can I force the merging of the menu contained on the second user control with the Main Menu.

Thanks in advance.

Webform Grid Control With Varying Columns


I will do my best to explain what I am trying to accomplish.  I am trying to create a recipe system that will pull material amounts from an already built inventory database upon request for testing purposes of the different recipe runs.  What is throwing me for a loop is that each time a user will request a recipe comparison they will have a different number of recipe trial runs for comparison purposes.  In order to do this I'm guessing you will need to generate a gridview-like control with a dynamic number of columns which would be specified on a web form page prior to arriving at the recipe formulation page which will contain the control for the recipe formulation.  As a result the user will have different columns and rows on this formulation page, with the rows being a static number of 30 (30 being maximum amount of ingredients to include in each recipe).  The columns will contain the recipes to be compared, i.e. ProductRun1, ProductRun2, ProductRun3, where the number of ProductRunX will be determined by user input.  So the user when they come to this aspx page will be presented with a blank editable grid of X columns by 30 rows deep.  The left-most column will contain the ingredient names in a drop down box for users to select to input into their recipe and the rest of the columns will be editable fields where the user can type in t

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend