C# - Is There Equivalent Of WPF OriginalSource Event Property In Winform?

Jan 23, 2011

From:

[URL]

The OriginalSource property of the object identifies the original object that received/initiated the event. Consider a custom control (called CustomControl1 in this example) that is composed of a TextBlock. When a MouseDown event is raised on the TextBlock, the OriginalSource property will be the TextBlock, but in CustomControl1's handler, the Source will be changed to the CustomControl1 object so that other elements along the event's route will know that CustomControl1 received a MouseDown.

Is there equivalent of WPF OriginalSource event property in Winform and ASP.NET ? If not how to emulate this ?

View 1 Replies


Similar Messages:

C# - Plug Dependency Property Framework To Winform Or .NET ?

Dec 18, 2010

The dependency property framework is a general UI Framework that can be needed outside WPF. So is there a way to use it for Winforms or ASP.NET UI for example ?

Update: I mean can I declare a few namespaces and use dependency property framework in winforms and asp.net ?

View 3 Replies

How To Add Postbackurl Equivalent Property To <div Runat="server" />

Apr 27, 2010

I need a div element to cause postback to the server. I can use window.location tough but then I think I won't be able to fire any event back on the server. How can I call the asp.net generated dopostback function properly?

View 1 Replies

Write Property In A Property IN The Page Load Event?

Sep 21, 2010

Can we write property in property?IN the page load event we have page property and we can find another page property in that page property.Pls let me know how this is happening

View 5 Replies

Winform Versus MVC

Jun 1, 2010

I want to know when to use winform and MVC asp.net

View 11 Replies

C# - Adding Delegate Or Event Property To Class?

Oct 4, 2010

I created a control where other developers can create an instance and use. There is a button click in the control. How do I allow developers to plug in their own code in a certain part of my control? I am not sure if or how exactly to use a delegate or event in this scenario.

[code].....

How to I update MyControl to allow this?

View 4 Replies

Acessof Undefined Property Event And Resolve It?

Feb 10, 2010

public function assgn()
{
var recA:Sprite = new Sprite();

[code]...

View 1 Replies

How To Print A Pdf From Winform Without Opening

Oct 25, 2010

I have pdf file saved on my hard disk. I want to print it without opening it in a single click.

View 1 Replies

Convert A WinForm To A WebForm In .NET?

Dec 7, 2010

I didn't think it was possible but I was just talking to a co-worker who said she had done it before. Is she pulling my chain?

View 4 Replies

Web Forms :: How To Convert Winform Component

Jan 25, 2010

I have succeeded in capturing image from webcam with window form.

There is a problem, i.e I'd like to apply this application on web page.

I try to convert winform component to webform component

(Winform Component (PictureBox) to Web User Control (asp:Image)), but it fails.

View 1 Replies

Architecture :: Integrate .NET Page Into A Winform

Apr 1, 2011

I've an ASP.NET application running for reporting purposes. This is done for the management. The persons on the production floor have

a windows application running. Some of them needs to view the ASP.NET reporting page. To avoid writing twice the same reporting tools

(ASP.NET and Windows application) I want to import the ASP.Net pages into a windows form. I don't want to have the ASP.NET pages running

outside the windows application.

View 1 Replies

C# - Trigger On Database Using A Web And Winform Application

May 25, 2010

Situation: I have a web application which shows errors and where you can accept those error messages. I also have a service, which checks errors from a system and sets the error messages in the database. When I accept an error in the web application, i would like the service to know which error message has been accepted, so that it can do some other actions. My guess is that this could be done through some sort of trigger, but i can't figure out how.

View 1 Replies

C# - Can Create A PDF Quotation File From Winform

Aug 6, 2010

Assuming i have a winform that has a button called "Create a Quote". Once user clicks it, a PDF File gets created on desktop. The PDF File has a fixed design/structure e.g. the logo is at the top left corner, the headers are fixed, etc. However, the data it self is pulled from a database.

As you see above, Quotation #, Description, Qty, U.P (USD), T.P (USD) records should be fetched from the db and dumped in the pdf template then create the pdf for user.

View 1 Replies

Web Forms :: CheckedChanged Event Not Firing When Checked Property Set On Page_Load

Jul 21, 2010

I have a web form with two RadioButtons, both use the same GroupName, both have AutoPostback enabled and both have an event handler for CheckChanged. I use tem to show/hide a Panel further down the form which is contained in an UpdatePanel with Conditional Update set and with both CheckedChanged events in the Triggers collection:

[Code]....

Now, the problem arises when I set the Checked property of either RadioButton in Page_Load, which results in the even not firing for the button which was marked as Checked (the event for the radio button whose property was not assigned does get fired). In fact, upon inspecting the source there was no 'onclick' attribute declared for the input element that was marked as checked in the Page_Load, whereas the other RadioButton did have the 'onclick' attribute properly set.

The layout of the form doesn't allow me to place the radio buttons within the UpdatePanel, so that is out of the question. Is the behavior explained above normal? am I missing anything? Both events fire once the assignment to the Checked property is removed from Page_Load.

View 13 Replies

How To Determine If The Executing Assembly Is A Web App Or Winform/console

Apr 16, 2010

I would like to write a helper function which build the exception message to write to a log.The code look like:

if(IsWebApp)
{
use HttpContext to get the Request Path and RawUrl [code]....

View 4 Replies

Create Global.asax In Winform Application?

May 17, 2010

I'm trying to create Global.asax in a Winform. I could do it in ASP.NET, but i couldn't find a way for Windows Application. I have a singleton class called DataAccessLayer, i need to instantiate it once only, so i can call its method/properties anywhere in the application easily.

View 5 Replies

JQuery Application Running From CD - Convert In A WinForm App

Mar 9, 2010

I've developed a very simple ASP.NET (jQuery) application. The RDBMS is MS Sql Server but I could easily convert it in MS Access. My client would like to have it available on a CD, ready to run. I was thinking to convert it in a WinForm app but, still, I have to install the framework on the client. Is there any other "possible" solution?

View 5 Replies

Web Forms :: Signed WinForm Control Not Showing In Web Page?

Nov 8, 2010

I developped a light WinForm Control that run like an ActiveX in a Web Page. No problem yet.However, when i want to access System.IO I got a Security Exception. It seems that I have to sign my assembly, so that's what I did. When my assembly is signed, my Web Browser can't show the Winform. I set IE to download any ActiveX in the Security tab ... Nothing happens. Uncheck "Sign Assembly" ... works fine ...

View 2 Replies

Simulate Virtual Users Interacting With Winform Or ASP Application?

Mar 10, 2011

Microsoft release a product named - Visual Studio Load Test Virtual User Pack 2010 to do that. However, it cost USD$4,799. So,is it other free or commercial tool can do simulate jobs? At now, my solution is :

Winform :
3 x virtualbox + WinXP with some macro software.

ASP.NET
3 x virtualbox + WinXP + Firefox and iMacro

View 3 Replies

System.Security.Permissions.SecurityPermission Winform In Webform?

Nov 22, 2010

It's a ?/$%/$%"!$ mess ... My webpage contains a winform user control. That user control send text to LPT1.It acts like an ActiveX. I set my website (on localmachine) as a trust one in IE and set all properties for ActiveX under security tab. The user control is showed under IE but I got a System.Security.Permissions.SecurityPermission when execute it.When I sign my control, IE can't display it ! I registered the dll in the .Net Framework Configuration tool

View 3 Replies

C# - Parameter Is Not Valid Exception When Saving Image In Winform?

Nov 22, 2010

I am getting a parameter is not valid exception..While saving the image

Here is my code to save the image

if (!File.Exists(pictureBox1.Tag.ToString()))
{
Image image = pictureBox1.Image;
image.Save(pictureBox1.Tag.ToString(), ImageFormat.Jpeg);
}
else
{
string delStr = pictureBox1.Tag.ToString();
pictureBox1.Image.Dispose();
File.Delete(delStr);
Image image = pictureBox1.Image;
image.Save(delStr, ImageFormat.Jpeg);
pictureBox1.Image = Image.FromFile(delStr);
}

View 2 Replies

Get Total Row Count And Why Is The GridView's DataSource Property Null In The DataBound Event Handler

Jul 22, 2010

I wanted to get the total row count in a GridView's databound event handler, so I tried the following:

protected void grid_DataBound(object sender, EventArgs e)
{
GridView grid = (GridView)sender;
DataSet data = grid.DataSource as DataSet;
if (data == null)
return;
int totalRows = data.Tables[0].Rows.Count;
}

The problem is that the grid.DataSource property is null. The DataSourceID property is not null, so does that mean that I can't access the DataSource object in the DataBound event handler unless I assign the DataSource property directly?

Edit1: Here is the code in my GridHelper class for adding rowcount to the BottomPagerRow. I would like to get rid of the requirement to pass in the ObjectDataSource, but can't because I need to use the Selected event to get total row count. Hence the reason for the question. I also think this might be better in a custom control where I can access ViewState, and/or create child controls during the Init event (I still have a problem to resolve with the way the pager renders with an extra cell), but then I'd still have the problem of how to get to the total row count when the DataSource itself doesn't appear to be available in any GridView events.

Edit 2: Not really relevant to the specific problem, but I resolved the problem I was having with the pager rendering so i've updated the code posted. I found the trick here: [URL]

#region Fields
private int totalRows = -1;
#endregion
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="GridHelper"/> class.
/// Adds EventHandlers to the GridView to display results from the ObjectDataSource in the footer.
/// Marked as obsolete because AddResultsToFooter method provides a static access to the same functionality
/// An instance of GridHelper is required by the passed in GridView to store the totalRows value between the two event handlers
/// </summary>
/// <param name="grid">The grid.</param>
/// <param name="source">The ObjectDataSource linked to the GridView.</param>
[Obsolete("Use AddResultsToFooter instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public GridHelper(GridView grid, ObjectDataSource source)
{
source.Selected += source_Selected;
grid.PreRender += grid_PreRender;
}
#endregion
#region Event Handlers
private void grid_PreRender(object sender, EventArgs e)
{
GridView grid = (GridView)sender;
if (grid.HeaderRow != null)
grid.HeaderRow.TableSection = TableRowSection.TableHeader;
//Add a cell to the bottom pager row to display the total results
if (grid.BottomPagerRow == null || !grid.BottomPagerRow.Visible)
return;
//Get the control used to render the pager
//http://michaelmerrell.com/2010/01/dynamically-modifying-the-asp-net-gridview-paging-control/
Table tblPager = grid.BottomPagerRow.Cells[0].Controls[0] as Table;
if (tblPager == null)
return;
if (totalRows < 0)
{
//The DataSource has not been refreshed so get totalRows from round trip to client
addResultsToPagerTable(tblPager, grid.Attributes["results"]);
return;
}
int firstRow = grid.PageIndex * grid.PageSize + 1;
int lastRow = firstRow + grid.Rows.Count - 1;
string results;
if (totalRows <= grid.PageSize)
results = string.Format("<span class='grid-pager'>{0} Results</span>", totalRows);
else
results = string.Format("Results <b>{0}</b> to <b>{1}</b> of <b>{2}</b>", firstRow, lastRow, totalRows);
addResultsToPagerTable(tblPager, results);
//Need to store the information somewhere that is persisted via ViewState, and we don't have access to ViewState here
grid.Attributes.Add("results", results);
}
/// <summary>
/// Handles the Selected event of the source control. Gets the total rows, since it is not possible to access them from the GridView.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.Web.UI.WebControls.ObjectDataSourceStatusEventArgs"/> instance containing the event data.</param>
private void source_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.ReturnValue is DataView)
totalRows = ((DataView)e.ReturnValue).Count;
else if (e.ReturnValue is EntitySet)
totalRows = ((EntitySet)e.ReturnValue).Count;
}
#endregion
#region Private Methods
private static void addResultsToPagerTable(Table tblPager, string results)
{
//http://michaelmerrell.com/2010/01/dynamically-modifying-the-asp-net-gridview-paging-control/
//Get a handle to the original pager row
TableRow pagesTableRow = tblPager.Rows[0];
//Add enough cells to make the pager row bigger than the label we're adding
while (pagesTableRow.Cells.Count < 10)
pagesTableRow.Cells.Add(new TableCell { BorderStyle = BorderStyle.None });
//Add a new cell in a new row to the table
TableRow newTableRow = new TableRow();
newTableRow.Cells.AddAt(0, new TableCell
{
Text = results,
BorderStyle = BorderStyle.None,
ColumnSpan = pagesTableRow.Cells.Count
});
tblPager.Rows.AddAt(0, newTableRow);
}
#endregion
#region Public Methods
/// <summary>
/// Adds EventHandlers to the GridView to display results from the ObjectDataSource in the footer.
/// </summary>
/// <param name="grid">The GridView.</param>
/// <param name="source">The ObjectDataSource linked to the GridView.</param>
public static void AddResultsToFooter(GridView grid, ObjectDataSource source)
{
if (grid == null)
throw new ArgumentNullException("grid", "grid is null.");
if (source == null)
throw new ArgumentNullException("source", "source is null.");
new GridHelper(grid, source);
}
#endregion

View 1 Replies

SQL Reporting :: Display SSRS Report Based On Winform Parameters?

Jan 25, 2011

I need to display report in winform based on winform parameters.

I'm ve in SSRS report via URL, I deployed in Reportviewer in winform . Now I need to display that report based on my win form parameters i.e., I'm ve in textbox and button.

I ve to enter related item in textbox and when I press the button the report should be viewed based on this values. Remember I'm calling report via URL.

View 2 Replies

C# - Convert WinForm To WebForm / Show Database Grid On Screen?

Nov 26, 2010

i have C# Winform program and i need to convert it to Webform. can i get any simple sample for how to show database grid on screen,

add new, update and delete ?

i try to show table on screen like this:

SQL = "SELECT * FROM MEN order by Lname";
dsView = new DataSet();
adp = new SqlDataAdapter(SQL, Conn);
adp.Fill(dsView, "MEN");
adp.Dispose();
GridView1.DataSource = dsView.Tables["MEN"].DefaultView;

View 1 Replies

Forms Data Controls :: How To Set The TextBox.Text Property Of The Parent Page From The RowCommand Event

Mar 31, 2011

i have some textboxes in my parent page and a search button. when the search button is clicked, my modalpopup pops up. after chosing (clicking on the select button of the row) an entry from a gridview within my modalpopup (each row in the gridview has a buttonField), the rowCommand_Event fires... within this event i try to set the .Text property of some textboxes within the page containing my modalpopupExtender... i get no exceptions, but the textboxes are not set...

ModalPopupExtender:

[Code]....

ModalPopupPanel:

[Code]....

RowCommandEvent:

[Code]....

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved