I am implementing a datagridview and a button on it using below code:
$Column2 = $TR = New-Object System.Windows.Forms.DataGridViewButtonColumn
$Column2.width = 150
$Column2.name = "App Data"
$Column2.FlatStyle = 'Standard'
$DataGridView1.Columns.Add($Column2)
$Column2.UseColumnTextForButtonValue = $true
$Column2.AutoSizeMode = 'DisplayedCells'
$TR.Text = "Change Data"
When I click another button (not the one implemented on grid), I need to change the text of button implemented on grid to something. For example, from "Change Data" to "Delete Data".
And also how do I implement Click event for button implemented on the grid.
Thanks heaps for your help!
Nratawa
Related
i have a question regarding the back/next button label for primefaces wizard. It is possible to customize the navigation button label like the following example:
Button label at step 0 -> Show button label text "Next 1"
Button label at step 1 -> Show button label text "Next 2" and button back label "Back 1"
Button label at step 2 -> Show button label text "Next 3" and button back label "Back 2"
...
Best regards,
Mux
Yes the component has two attributes the nextLabel and backLabel.
https://primefaces.github.io/primefaces/7_0/#/components/wizard?id=attributes
nextLabel null String Label of next navigation button.
backLabel null String Label of back navigation button.
Then do..
<p:wizard widgetVar="wgtWizard" nextLabel="Next #{component.step}" backLabel="Back #{component.step}">
But since the #component.step is not evaluated on every step you have to do it with JQuery JS code like this following:
var wizard = PF('wgtWizard');
var stepIndex = wizard.getStepIndex(wizard.currentStep);
wizard.nextNav.find('.ui-button-text').text('Next ' + stepIndex);
wizard.backNav.find('.ui-button-text').text('Back ' + (stepIndex-1));
Just execute that JS code on the wizard 'onback' and 'onnext' JS methods.
i'm creating a x number of buttons runtime in this way:
btn is Control
btn <- ControlCreate(name,typButton,mouseX,mouseY,mouseXRel-mouseX,mouseYRel-mouseY,True)
btn..Caption = name
btn..Process[trtClick] = buttonAction
the buttonAction code is:
Info("You pressed: " + btn..Caption)
But the result of the buttonAction is always the last button name I create, for eg. I create a button named "Luca" and when I click it the result is: You pressed: Luca. Then i create a new button named "Antonio" but when I press "Luca" button the output is You pressed Antonio. How can I assign one button action runtime for every button?
Did you try to create a control per button ?
Where did you run the creation of the buttons ?
Like:
btn1 is Control
btn1 <- ControlCreate("test1",typButton,mouseX,mouseY,mouseXRel-mouseX,mouseYRel-mouseY,True)
btn1..Caption = "test1"
btn1..Process[trtClick] = buttonAction
btn2 is Control
btn2 <- ControlCreate("test2",typButton,mouseX,mouseY,mouseXRel-mouseX,mouseYRel-mouseY,True)
btn2..Caption = "test2"
btn2..Process[trtClick] = buttonAction
What result do you get ?
I don't have the last version of Windev for tests.
I'm afraid "btn" became shared to the windows when you use
<- ControlCreate
I have used standard report designer in winform and added a button "Export to PDf" in designer bar.
I want that when i click on this button , opened report or edited report in designer should be exported in pdf.
Please give solution to do this.
You need to add a button in the ribbon and enable the export command with that button. See the below code snippet from the DevExpress sample project for reports in version 14.2.5.
Create a button item in PrintPreview tab and specify it's properties as below:
private DevExpress.XtraPrinting.Preview.PrintPreviewBarItem printPreviewBarItem23;
this.ribbonControl1.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
.....
this.printPreviewBarItem23
.....
};
//
// printPreviewBarItem23
//
this.printPreviewBarItem23.ButtonStyle = DevExpress.XtraBars.BarButtonStyle.DropDown;
this.printPreviewBarItem23.Caption = "Export To";
this.printPreviewBarItem23.Command = DevExpress.XtraPrinting.PrintingSystemCommand.ExportFile;
this.printPreviewBarItem23.ContextSpecifier = this.xrDesignRibbonController1;
this.printPreviewBarItem23.Enabled = false;
this.printPreviewBarItem23.Glyph = ((System.Drawing.Image)(resources.GetObject("printPreviewBarItem23.Glyph")));
this.printPreviewBarItem23.Id = 91;
this.printPreviewBarItem23.LargeGlyph = ((System.Drawing.Image)(resources.GetObject("printPreviewBarItem23.LargeGlyph")));
this.printPreviewBarItem23.Name = "printPreviewBarItem23";
-GUI view
You can add a single command button to just export it to pdf, but you need to check for that specific properties you need to set on the control. You can do above programmatic work in Report designer.
Hope this help.
I have a classic ASP NET page on my SharePoint site with several buttons in it:
Button importZIPPOTBtn = new Button();
importZIPPOTBtn.Click += new EventHandler(importZIPPOTBtn_Click);
this.Controls.Add(new LiteralControl("<br/><br/>"));
this.Controls.Add(importZIPPOTBtn);
The first click on any button is perfectly firing the event, but any further click on any button doesn't fire, I can't understand why...
Consider aadding button to form1 or container element like panel inside page.
Button importZIPPOTBtn = new Button();
importZIPPOTBtn.Click += new EventHandler(importZIPPOTBtn_Click);
this.form1.Controls.Add(new LiteralControl("<br/><br/>"));
this.form1.Controls.Add(importZIPPOTBtn);
You can verfiy in html source, unless you add this way even literal control containing lines breaks will not be rendered.
i have 2 aspax page.
client.aspx
popup.aspx
client.aspx contains a simple registration form. in this form i have to take one of the textbox value from popup.aspx. that textbox contains with a search button
when i click on search button popup.aspx page is opened in a popup window.
in popup.aspx i m showing a grid contains productCode and product name and a select button.
when i select a row of grid then corresponding product name should be displyed in textbox. and tht popup window should be closed.
Update
ImageButton imgbut = sender as ImageButton;
GridViewRow gvr = (GridViewRow)imgbut.NamingContainer;
lblKeyIndex.Text = grd_ProductMaster.DataKeys[gvr.RowIndex].Value.ToString();
lblProductName.Text = gvr.Cells[2].Text;
Session["ProdName"] = lblProductName.Text;
Server.Transfer("client_Master.aspx");
Response.Write("<Script>window.close()</Script>"); Response.Redirect("client_Master.aspx?ProdName=" + lblProductName.Text+"&ProdCode="+lblKeyIndex.Text)
on page load of client.aspx
if (Session["ProdName"] != null)
{
txtSelectProdName.Text = Session["ProdName"].ToString();
}
Open a pop-up window
In your pop-up window try to return the value to parent window.