Hi Friends..
I have a one Gridview with four fields like select,Name,Sample ID, Image
select fields having a CheckBox, Name is the Bound fied which is access the data from XMLDatasource, SampleID is Template field is having TextBox,and Image is also template field Having Image...There is one Button called Generate SampleID, when i click the button control i want display the SampleID (ex: take todays date formate as a SampleID), image (like Barcode) at a time...one thing the Sample id is Shown in particular Barcode image..
here i am sending my HTML Code,
<%
<!
<
//Page Refreshing
// //Function called during body onload
//function body_onload(){
//window.setTimeout(RefreshPage, 300);
//}
////Function to refresh the page
//function RefreshPage(){
//document.forms(0).submit();
function
// Added as ASPX uses SPAN for checkbox
var
xState=theBox.checked;
elm=theBox.form.elements;
for
if
{
//elm[i].click();
elm[i].click();
//elm[i].checked=xState;
}
</
var TotalChkBx;
var Counter;
window.onload = function()
//Get total no. of CheckBoxes in side the GridView.
TotalChkBx = parseInt('<%= this.gvCheckboxes.Rows.Count %>');
//Get total no. of checked CheckBoxes in side the GridView.
Counter = 0;
function HeaderClick(CheckBox)
//Get target base & child control.
var TargetBaseControl =
document.getElementById('<%= this.gvCheckboxes.ClientID %>');
var TargetChildControl = "chkBxSelect";
//Get all the control of the type INPUT in the base control.
var Inputs = TargetBaseControl.getElementsByTagName("input");
//Checked/Unchecked all the checkBoxes in side the GridView.
for(var n = 0; n < Inputs.length; ++n)
if(Inputs[n].type == 'checkbox' &&
Inputs[n].id.indexOf(TargetChildControl,0) >= 0)
Inputs[n].checked = CheckBox.checked;
//Reset Counter
Counter = CheckBox.checked ? TotalChkBx : 0;
function ChildClick(CheckBox, HCheckBox)
//get target control.
var HeaderCheckBox = document.getElementById(HCheckBox);
//Modifiy Counter;
if(CheckBox.checked && Counter < TotalChkBx)
Counter++;
else if(Counter > 0)
Counter--;
//Change state of the header CheckBox.
if(Counter < TotalChkBx)
HeaderCheckBox.checked = false;
else if(Counter == TotalChkBx)
HeaderCheckBox.checked = true;
</script>--
AutoGenerateColumns="False" OnRowCreated="gvCheckboxes_RowCreated" Width="179px" DataSourceID="XmlDataSource1" CellPadding="4" CssClass="grid-view" ForeColor="#333333" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Select">
<ItemTemplate>
<asp:CheckBox ID="chkBxSelect" runat="server" />
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
<HeaderTemplate>
<asp:CheckBox ID="chkBxHeader"
onclick="javascript:HeaderClick(this);" runat="server" />
</HeaderTemplate>
</asp:TemplateField>
<asp:BoundField DataField="MRN" HeaderText="MRN" SortExpression="MRN" />
<asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
</Columns>
<RowStyle BackColor="#EFF3FB" />
<AlternatingRowStyle BackColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
</asp:GridView>--
Code Behind i used C#....
int
c_date = c_date.Replace(
c_date = c_date + i;
txt.Text = c_date;
System.Drawing.
img1 = Care21.Components.BarCode.Engine.
BarcodeGenerator.
ImgObj = BarcodeGenerate.Code128(2,
ImgObj.Save(
img.ImageUrl =
i++;
....
its working fine, but it will take last data value for all the images....
Just Tell Me How Generate ....
Advance Thanks ..Hope you people getting my problem...
Basu Malipatil