Wednesday 29 March 2017

Responsive Table First Row with all columns using CSS

/// CSS

<style type="text/css">
        .tblcssresponse
        {
            width: 100%;
        }
        .td1, .td3
        {
            width: 45%;
        }
        .td2
        {
            width: 10%;
        }
        @media all and (max-width:750px)
        {
            .tblcssresponse
            {
                width: 100%;
            }
            .td1, .td3
            {
                width: 100%;
            }
            .td2
            {
                width: 100%;
            }
           .tblcssresponse tr td
            {
                display: block;
                width: 100%;
            }
       
           .tblcssresponse tr
            {
                display: block;
                margin-bottom: 30px;
            }
        }

    </style>


/// HTML

<table class="tblcssresponse">
  
            <tr>
                <td class="td1">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                 <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 p-0 thumbnail">
                 column1
                 </div>
                </div>
                </td>
                <td class="td2">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 p-0 thumbnail">
                  column2
                  </div>
                </div>
                </td>
                <td class="td3">
                 <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 p-0 thumbnail">
                 
                 column3
                  </div>
                 </div>
                </td>
            </tr>
    

    </table>



/// REsult

before


After




Monday 20 March 2017

Set Selected checkboxlist in c#

/// Codebehind

if (MemberInformationDt.Rows[0]["GovtScheme"].ToString() != "")
        {
            string GovtScheme = MemberInformationDt.Rows[0]["GovtScheme"].ToString();   
            for (int j = 0; j < chkGovtScheme.Items.Count; j++)
            {
                DataRowView dv = chkGovtScheme.Items[j] as DataRowView;
                int vv = (int)dv["SchemeID"];
                if (GovtScheme.Contains(vv.ToString()))
                {
                    chkGovtScheme.SetItemChecked(j, true);
                }
            }

        }



Thursday 2 March 2017

How to set multiple Checked in CheckBoxList in asp.net



///   C#

    public void Set_CheckBoxList_Values(CheckBoxList cbl, string[] values)
    {
        foreach (ListItem item in cbl.Items)
        {
            item.Selected = values.Contains(item.Value);
        }
     }

/// Call 

string[] Partner = Convert.ToString(dtvp_A.Rows[0]["PartnerName"]).Split(',');
SetCheckBoxListValues(CBL_aNamePartner, Partner);

   

/// Result


Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...