|
you need to call the javascript to the control within it for those particular events...
Abhishek Sur
|
|
|
|
|
hi all,
can you please help me in Creating of gridviewrowdatabound Event using Model-View-Presenter Pattren.
Thanks And Regards,
Guru
|
|
|
|
|
Hi All
How to change an image/icon in datagrid when a button (External/outside tha datagrid) is clicked.
let be more precise..
Here I am Using Template Column to do Edit , Update and Cancel Actions.
when i click on AddNew Row Button..The datagrid displays a new blank row along with Update and Cancel Icons(including tooltips).But I need to change Update Icon to Insert Icon..
How Can this be done???...
I have tried with following code...
Dim enable As ImageButton = DirectCast(StatusGrid.FindControl("btnUpdate"), ImageButton)
enable.ImageUrl = "<img border = 0 src = ./Icons/add.jpg>"
enable.ToolTip = "Insert"
but I got "Object reference not set to an instance of an object." error
Please Guide...
Thank you.
|
|
|
|
|
Call the FindControl function on the row which is assigned to insert. The code should be like this.
DirectCast(StatusGrid.Rows[Row Index].Cells[Column Index].FindControl("btnUpdate"), ImageButton)
|
|
|
|
|
Hi Kannan,
Thanks for your reply...
I tried with that code, but i am getting error as
"Rows is not member of System.Web.Ui.WebControls.Datagrid"
please Suggest..
Thanks
|
|
|
|
|
Thanks Kannan,
I Got It.
|
|
|
|
|
how can i add datafield value
if my column coming from database name "status" and 0,1 bit values are coming..
i want to place in datafield=if status=0 then "disable" else "active"
how is it possible ???
umerumerumer
|
|
|
|
|
try this , may be this can help . first fill gridview with Data .
for(int i=0;i<gridview1.rows.count;i++)>
{
// first find that field
lable status = (Lable)(GridView1.rows[i].FindControl("lblstatus"));
int st = Convert.ToInt(status.text);
if(st==0)
{
status.visible=false;
}
else
{
status.visible=true;
}
}
|
|
|
|
|
Implement a Binding function and do it there.
C# has already designed away most of the tedium of C++.
|
|
|
|
|
this code not working can any help
Document document = new Document();
try
{
System.IO.MemoryStream msReport = new System.IO.MemoryStream();
PdfWriter writer = PdfWriter.GetInstance(document, msReport);
document.Open();
iTextSharp.text.Table datatable = new iTextSharp.text.Table(8);
datatable.Padding = 4;
datatable.Spacing = 0;
//datatable.setBorder(Rectangle.NO_BORDER);
float[] headerwidths = { 50, 50, 50, 50, 50, 40, 40, 45 };
datatable.Widths = headerwidths;
datatable.WidthPercentage = 100;
Cell cell = new Cell(new Phrase("Applicant Wise Report", FontFactory.GetFont(FontFactory.HELVETICA, 15 ,Font.BOLD)));
cell.HorizontalAlignment = Element.ALIGN_CENTER;
cell.Leading = 15;
cell.Colspan = 8;
cell.Border = Rectangle.NO_BORDER;
cell.BackgroundColor = new Color(0xC0, 0xC0, 0xC0);
datatable.AddCell(cell);
datatable.DefaultCellBorderWidth = 1;
datatable.DefaultHorizontalAlignment = 1;
datatable.DefaultRowspan = 1;
datatable.AddCell(new Phrase("Name", FontFactory.GetFont(FontFactory.TIMES, 11, Font.BOLD)));
datatable.AddCell(new Phrase("Address", FontFactory.GetFont(FontFactory.TIMES, 11, Font.BOLD)));
datatable.AddCell(new Phrase("State", FontFactory.GetFont(FontFactory.TIMES, 11, Font.BOLD)));
datatable.AddCell(new Phrase("City", FontFactory.GetFont(FontFactory.TIMES, 11, Font.BOLD)));
datatable.AddCell(new Phrase("Email ID", FontFactory.GetFont(FontFactory.TIMES, 11, Font.BOLD)));
datatable.AddCell(new Phrase("Exam Attended", FontFactory.GetFont(FontFactory.TIMES, 11, Font.BOLD)));
datatable.AddCell(new Phrase("Result Status", FontFactory.GetFont(FontFactory.TIMES, 11, Font.BOLD)));
datatable.AddCell(new Phrase("Exam Date", FontFactory.GetFont(FontFactory.TIMES, 11, Font.BOLD)));
datatable.DefaultCellBorderWidth = 1;
datatable.DefaultRowspan = 1;
if (Dt.Rows.Count > 0)
{
for (int i = 0; i <= Dt.Rows.Count - 1; i++)
{
datatable.DefaultHorizontalAlignment = Element.ALIGN_LEFT;
string name = Convert.ToString(Dt.Rows[i][0]);
datatable.AddCell(new Cell(new Phrase(name, FontFactory.GetFont(FontFactory.TIMES, 10, Font.NORMAL))),i+1,0);
string address = Convert.ToString(Dt.Rows[i][1]);
datatable.AddCell(new Cell(new Phrase(address, FontFactory.GetFont(FontFactory.TIMES, 10, Font.NORMAL))), i + 1, 1);
string state = Convert.ToString(Dt.Rows[i][2]);
datatable.AddCell(new Cell(new Phrase(state, FontFactory.GetFont(FontFactory.TIMES, 10, Font.NORMAL))), i + 1, 2);
string city = Convert.ToString(Dt.Rows[i][3]);
datatable.AddCell(new Cell(new Phrase(city, FontFactory.GetFont(FontFactory.TIMES, 10, Font.NORMAL))), i + 1, 3);
string mailid = Convert.ToString(Dt.Rows[i][4]);
datatable.AddCell(new Cell(new Phrase(mailid, FontFactory.GetFont(FontFactory.TIMES, 10, Font.NORMAL))), i + 1, 4);
string exam = Convert.ToString(Dt.Rows[i][5]);
datatable.AddCell(new Cell(new Phrase(exam, FontFactory.GetFont(FontFactory.TIMES, 10, Font.NORMAL))), i + 1, 5);
string result = Convert.ToString(Dt.Rows[i][6]);
datatable.AddCell(new Cell(new Phrase(result, FontFactory.GetFont(FontFactory.TIMES, 10, Font.NORMAL))), i + 1, 6);
string examdate = Convert.ToString(Dt.Rows[i][7]);
datatable.AddCell(new Cell(new Phrase(examdate, FontFactory.GetFont(FontFactory.TIMES, 10, Font.NORMAL))), i + 1, 7);
}
document.Add(datatable);
}
document.Close();
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=ApplicantWiseReport.pdf");
Response.ContentType = "application/pdf";
Response.BinaryWrite(msReport.ToArray());
Response.End();
|
|
|
|
|
|
if we want to take value in control through javascript
we will use
var ds = document.getElementById("dvMyDiv").value ;
if we are using master page means
var ds = document.getElementById("<%=dvMyDiv.ClientID %>").value ;
Why we are using ClientID while using master page ?
|
|
|
|
|
md_azy wrote: Why we are using ClientID while using master page ?
No idea, its your design, don't you know why you are doing it?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Whenever you are using MasterPages, the master page can contain dvMyDiv into it. So if you call it with this name only, it will be calling the masterpage dvMyDiv.
Generally after rendering the page, which is inside the masterpage, .NET prefix each control within the page with the masterpage placeholder name. Thus ambiguity could be removed by this.
Thus from javascript if you want to find this control, you need to call the valid object, means contentplaceholdername_dvMyDiv. Otherwise you could replace the javascript call through the server tags with the appropriate client id. Check your view source, you will get the idea of what the id of the control looks like in your page.
Abhishek Sur
|
|
|
|
|
md_azy wrote: Why we are using ClientID while using master page ?
Whenever a server control is inside a container control (like the Content control used by content pages), the id of the container is prepended to the id of the control to ensure that every id in the page is unique.
So, it's not only when you have a master page.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
|
Please, this question has been asked so many times. Just search here on CP for "save image to database" and you will find loads of answers.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
How a pdf file can be converted into swf using C# .net
|
|
|
|
|
I think you need some tool for doing this....
such as Print2Flash does this for you ...
Abhishek Sur
|
|
|
|
|
Hi, i have done one webpage contains a download button. When i click on that button, it picks file from local drive and has given option to open/save dialog box. But it giving with name of .aspx page
The code is as follows
downloadExcel.aspx
protected void Button3_Click(object sender, EventArgs e)
{
string filepath = "D:\\csvData.csv";
FileInfo file = new FileInfo(filepath);
if (file.Exists)
{
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/vnd.ms-excel";
Response.WriteFile(file.FullName);
Response.End();
}
}
G. Satish
|
|
|
|
|
Hi,
I have a need to use ContextMenuStrip control in aspx page. Plz do help if u have any idea.
Thanks for any help!
Lakshmi
|
|
|
|
|
Get it
Sathesh.
Blessed is the season which engages the whole world in a conspiracy of love.
|
|
|
|
|
Thank u Sathesh,
I want to use that ContextMenuStrip control in web application, for that what i need to do, i know how to use contextmenustrip in windows forms.
Lakshmi
|
|
|
|
|
hi
ASP Or ASP.NET if you meant ASP.NET here is my reply.
it's not possible to use contextmenustrip in webpage (by ASP.NET and ASP)
You can study about javascript.
Or you can look for a third-party server control that does it for you(like Ajax Toolkit Controls)
I think that you can also use WPF controls but I am not sure.
wish best.
MK4
|
|
|
|
|
Thank u for your response....
I'll try to do like you said!
Lakshmi
|
|
|
|
|